Skip to content

Audio system

Romain Milbert edited this page Feb 22, 2023 · 2 revisions

On the AudioSystem's creation, an audio device will be opened. Like its name implies, it represents the audio output device that will be used. When adding an AudioSystem with no argument or an empty name, a default device is selected, which should be the one used by your operating system by default.

Opening a specific device

Any available audio device on your computer can be used. Those can be fetched by calling Raz::AudioSystem::recoverDevices(). One of the recovered names can then be given at the AudioSystem's creation, or later as an argument to its openDevice() member function.

NB: changing the device will invalidate all Sound, SoundEffect & SoundEffectSlot objects which were previously created. These must be recreated (see their respective init() function).

Clone this wiki locally