libretro.drivers.audio.driver¶
Interface for audio output.
See also
libretro.api.audioProvides the C callback and struct types that
AudioDriverimplementations use.
Classes
Protocol for drivers that receive audio output from the core. |
- class AudioDriver[source]¶
Bases:
ProtocolProtocol for drivers that receive audio output from the core.
Can be used with
isinstance().See also
libretro.api.audioThe C callback types and sample function signatures that implementations of this protocol accept.
- abstractmethod sample(left, right)[source]¶
Receives a single stereo audio sample from the core.
- Parameters:
See also
retro_audio_sample_tThe C function pointer type whose signature this method implements.
- Return type:
- abstractmethod sample_batch(frames)[source]¶
Receives a batch of interleaved stereo audio frames from the core.
- Parameters:
frames (
memoryview) – A read-onlymemoryviewof interleaved signed 16-bit stereo frames.- Return type:
- Returns:
The number of frames consumed.
See also
retro_audio_sample_batch_tThe C function pointer type whose signature this method implements.
- abstract property callbacks¶
The asynchronous audio callback registered by the core, if any.
Set via
RETRO_ENVIRONMENT_SET_AUDIO_CALLBACK.See also
retro_audio_callbackThe C struct registered by the core that contains this callback.
- set_state(enabled)[source]¶
Enable or disables the registered asynchronous audio callback.
Calls
retro_audio_callback.set_stateif a callback is registered.
- callback()[source]¶
Invoke the registered asynchronous audio callback, if any.
Calls
retro_audio_callback.callbackif a callback is registered.- Return type:
- abstract property buffer_status¶
The buffer-status callback registered by the core, if any.
Set via
RETRO_ENVIRONMENT_SET_AUDIO_BUFFER_STATUS_CALLBACK.See also
retro_audio_buffer_status_callbackThe C struct registered by the core that contains this callback.
- report_buffer_status(active, occupancy, underrun_likely)[source]¶
Invoke the registered buffer-status callback, if any.
- __init__(*args, **kwargs)¶
- classmethod __new__(*args, **kwargs)¶
- abstract property minimum_latency¶
The minimum audio latency in milliseconds requested by the core, if any.
Set via
RETRO_ENVIRONMENT_SET_MINIMUM_AUDIO_LATENCY.Noneif the core has not set a minimum latency.
- abstract property system_av_info¶
The AV info most recently set by the core.
Used by the driver to configure audio parameters such as sample rate.