libdonut
2.3.2
Application framework for cross-platform game development in C++20
|
Container for a particular sound wave that can be played in a SoundStage. More...
#include <donut/audio/Sound.hpp>
Public Member Functions | |
Sound (const Filesystem &filesystem, const char *filepath, const SoundOptions &options={}) | |
Load a sound from a virtual file. More... | |
void * | get () const noexcept |
Get an opaque handle to the internal representation of the sound. More... | |
Container for a particular sound wave that can be played in a SoundStage.
A single loaded sound can be used to spawn multiple sound instances that play the same sound at different times or in parallel, and with potentially varying volumes, positions and velocities.
donut::audio::Sound::Sound | ( | const Filesystem & | filesystem, |
const char * | filepath, | ||
const SoundOptions & | options = {} |
||
) |
Load a sound from a virtual file.
The supported file formats are:
filesystem | virtual filesystem to load the file from. |
filepath | virtual filepath of the sound file to load. |
options | sound options, see SoundOptions. |
File::Error | on failure to open the file. |
audio::Error | on failure to load a sound from the file. |
std::bad_alloc | on allocation failure. |
|
inlinenoexcept |
Get an opaque handle to the internal representation of the sound.