pub unsafe fn set_audio_callback(
    callback: retro_environment_t,
    data: retro_audio_callback
) -> bool
Expand description

Sets an interface which is used to notify a libretro core about audio being available for writing. The callback can be called from any thread, so a core using this must have a thread safe audio implementation.

It is intended for games where audio and video are completely asynchronous and audio can be generated on the fly. This interface is not recommended for use with emulators which have highly synchronous audio.

The callback only notifies about writability; the libretro core still has to call the normal audio callbacks to write audio. The audio callbacks must be called from within the notification callback. The amount of audio data to write is up to the implementation. Generally, the audio callback will be called continously in a loop.

Due to thread safety guarantees and lack of sync between audio and video, a frontend can selectively disallow this interface based on internal configuration. A core using this interface must also implement the “normal” audio interface.

A libretro core using set_audio_callback should also make use of set_frame_time_callback.