summaryrefslogtreecommitdiffstatshomepage
path: root/docs/source/luascript/ref-devices.rst
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2025-04-14 11:31:53 +0200
committer Olivier Galibert <galibert@pobox.com>2025-04-27 22:23:20 +0200
commitd0f1c15a0f6df2dd51a754cb46e6175b7079c8f2 (patch)
treebe35c94340442af08c316a8679089ee68e119fac /docs/source/luascript/ref-devices.rst
parentec636faeba5c5841c5a4a35b7c9dc2f06a00f538 (diff)
New sound infrastructure.
Should be added soon: - mute - speaker/microphone resampling To be added a little later: - compression - reverb Needs to be added by someone else: - coreaudio - direct - portaudio - xaudio2 - js
Diffstat (limited to 'docs/source/luascript/ref-devices.rst')
-rw-r--r--docs/source/luascript/ref-devices.rst49
1 files changed, 49 insertions, 0 deletions
diff --git a/docs/source/luascript/ref-devices.rst b/docs/source/luascript/ref-devices.rst
index 1c3eabdbd2d..23820deedef 100644
--- a/docs/source/luascript/ref-devices.rst
+++ b/docs/source/luascript/ref-devices.rst
@@ -67,6 +67,9 @@ manager.machine.images
manager.machine.slots
Returns a device enumerator that will iterate over
:ref:`slot devices <luascript-ref-dislot>` in the system.
+manager.machine.sounds
+ Returns a device enumerator that will iterate over
+ :ref:`sound devices <luascript-ref-disound>` in the system.
emu.device_enumerator(device, [depth])
Returns a device enumerator that will iterate over
:ref:`devices <luascript-ref-device>` in the sub-tree starting at the
@@ -624,6 +627,52 @@ image.device (read-only)
The underlying :ref:`device <luascript-ref-device>`.
+.. _luascript-ref-disound:
+
+Sound device interface
+---------------------
+
+Wraps MAME’s ``device_sound_interface`` class which is a mix-in implemented by
+devices that inputs and/or ouputs sound.
+
+Instantiation
+~~~~~~~~~~~~~
+
+manager.machine.sounds[tag]
+ Gets an sound device by tag relative to the root machine device, or ``nil``
+ if no such device exists or it is not a slot device.
+
+Properties
+~~~~~~~~~~
+
+sound.inputs (read-only)
+ Number of sound inputs of the device.
+
+sound.outputs (read-only)
+ Number of sound outputs of the device.
+
+sound.microphone (read-only)
+ True if the device is a microphone, false otherwise
+
+sound.speaker (read-only)
+ True if the device is a speaker, false otherwise
+
+sound.io_positions[] (read-only)
+ Non-empty only for microphones and speakers, indicates the positions of
+ the inputs or outputs as (x, y, z) coordinates (f.i. [-0.2, 0.0, 1.0])
+
+sound.io_names[] (read-only)
+ Non-empty only for microphones and speakers, indicates the positions of
+ the inputs or outputs as strings (f.i. Front Left)
+
+sound.hook
+ A boolean indicating whether to tap the output samples of this device in
+ the global sound hook.
+
+sound.device (read-only)
+ The underlying :ref:`device <luascript-ref-device>`.
+
+
.. _luascript-ref-dislot:
Slot device interface
mg class='inline' src='//www.gravatar.com/avatar/31beabae907e4ed2cf368847287d5e90?s=13&d=retro' /> Fabio Priuli2014-10-111-2/+4 * given to a couple of sound devices their own include. nw. Fabio Priuli2014-10-111-2/+4 * (file rename) Michaël Banaan Ananas2014-10-111-2/+2 * so long, cartslot.c... you made a really great job, when we Fabio Priuli2014-10-111-2/+0 * Untangled gottlieb audio from the arcade driver, so it becomes available for ... Robbbert2014-10-111-0/+1 * untangle some drivers from st0016_state now that it's a device (nw)