diff options
Diffstat (limited to 'docs/source/luascript')
-rw-r--r-- | docs/source/luascript/ref-common.rst | 7 | ||||
-rw-r--r-- | docs/source/luascript/ref-core.rst | 5 | ||||
-rw-r--r-- | docs/source/luascript/ref-devices.rst | 49 |
3 files changed, 58 insertions, 3 deletions
diff --git a/docs/source/luascript/ref-common.rst b/docs/source/luascript/ref-common.rst index c08d3676621..1cc467fe82a 100644 --- a/docs/source/luascript/ref-common.rst +++ b/docs/source/luascript/ref-common.rst @@ -99,6 +99,13 @@ emu.add_machine_post_load_notifier(callback) Add a callback to receive notification after the emulated system is restored to a previously saved state. Returns a :ref:`notifier subscription <luascript-ref-notifiersub>`. +emu.register_sound_update(callback) + Add a callback to receive new samples that have been created. THe + samples are coming from the sound devices for which the hook + property has been set to true. The callback gets one parameter + which is a hash with device tag as key and a (channel-sized) + vector of (buffer-sized) vector of + samples in the -1..1 range. emu.print_error(message) Print an error message. emu.print_warning(message) diff --git a/docs/source/luascript/ref-core.rst b/docs/source/luascript/ref-core.rst index 7b72d90ebdb..ad6dc24d330 100644 --- a/docs/source/luascript/ref-core.rst +++ b/docs/source/luascript/ref-core.rst @@ -404,9 +404,8 @@ sound.debugger_mute (read/write) sound.system_mute (read/write) A Boolean indicating whether sound output is muted at the request of the emulated system. -sound.attenuation (read/write) - The output volume attenuation in decibels. Should generally be a negative - integer or zero. +sound.volume (read/write) + The output volume in decibels. Should generally be a negative or zero. sound.recording (read-only) A Boolean indicating whether sound output is currently being recorded to a WAV file. 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 |