1 #ifndef DONUT_AUDIO_SOUND_HPP
2 #define DONUT_AUDIO_SOUND_HPP
242 [[nodiscard]]
void*
get() const noexcept {
247 struct SourceDeleter {
248 void operator()(
void* handle)
const noexcept;
Persistent system for managing the virtual filesystem.
Definition: Filesystem.hpp:185
constexpr Handle get() const noexcept
Get the value of the underlying resource handle.
Definition: UniqueHandle.hpp:152
Container for a particular sound wave that can be played in a SoundStage.
Definition: Sound.hpp:208
void * get() const noexcept
Get an opaque handle to the internal representation of the sound.
Definition: Sound.hpp:242
Sound(const Filesystem &filesystem, const char *filepath, const SoundOptions &options={})
Load a sound from a virtual file.
SoundAttenuationModel
Distance attenuation/falloff model for 3D positional audio.
Definition: Sound.hpp:14
@ INVERSE_DISTANCE
Attenuate the amplitude of the sound by the inverse distance between the sound instance and the liste...
@ EXPONENTIAL_DISTANCE
Attenuate the amplitude of the sound by the exponential distance between the sound instance and the l...
@ LINEAR_DISTANCE
Attenuate the amplitude of the sound by the linear distance between the sound instance and the listen...
@ NO_ATTENUATION
No distance attenuation; sound has the same volume regardless of distance between the sound instance ...
Configuration options for a Sound.
Definition: Sound.hpp:87
SoundAttenuationModel attenuationModel
Which distance attenuation/falloff model to use for 3D positional audio when playing this sound.
Definition: Sound.hpp:96
float volume
The default volume of instances of this sound, which is used if no volume override is specified when ...
Definition: Sound.hpp:106
float minDistance
The minimum distance of the range where the distance between the sound instance and listener changes ...
Definition: Sound.hpp:121
float rolloffFactor
The rolloff factor to use in the attenuation/falloff calculation for this sound.
Definition: Sound.hpp:155
bool looping
Play this sound on repeat instead of just playing it once.
Definition: Sound.hpp:189
float dopplerFactor
Strength of the doppler effect for this sound.
Definition: Sound.hpp:165
bool useDistanceDelay
Simulate the delay due to the speed of sound between the sound being played and the sound being heard...
Definition: Sound.hpp:175
float maxDistance
The maximum distance of the range where the distance between the sound instance and listener changes ...
Definition: Sound.hpp:137
bool singleInstance
Override any instances of this sound that are already playing when a new instance is played.
Definition: Sound.hpp:198
bool listenerRelative
Don't take the listener's sound stage position into account when playing this sound.
Definition: Sound.hpp:184