class

Raudio::AudioDevice

Inherits Reference < Object

Audio device management (singleton pattern) Handles initialization and cleanup of the audio device

Note: AudioDevice lifetime operations are synchronized for use from multiple fibers/threads. Individual audio resources should still be owned and updated from a dedicated audio/game context.

Class methods

close

Close the audio device This is automatically called at program exit if init was called Thread-safe: Can be safely called from any thread

Source
init

Initialize the audio device This is automatically called when using the block form Thread-safe: Can be safely called from any thread

Source
master_volume

Get master volume (listener) Thread-safe: Can be safely called from any thread

Source
master_volume=(volume : Float32) : Nil

Set master volume (listener) Thread-safe: Can be safely called from any thread

Source
open

Open audio device with automatic cleanup This is the recommended way to use the audio device Thread-safe: Can be safely called from any thread

Example:

AudioDevice.open do
  # Use audio here
end
Source
ready?

Check if audio device is ready Thread-safe: Can be safely called from any thread

Source