VAE - Virtual Audio Engine 1
Small Data Driven Audio Engine
vae_voice.hpp
Go to the documentation of this file.
1#ifndef _VAE_VOICE
2#define _VAE_VOICE
3
4#include "../vae_types.hpp"
5#include "../vae_config.hpp"
6#include <limits>
7
8namespace vae { namespace core {
9 /**
10 * @brief Barebones voice.
11 * Enough to play back a non spatialized and non filtered sound.
12 * Other structs extend this and depend on it
13 * @see VoicePan
14 * @see VoiceHRTF
15 * @see VoiceFilter
16 */
17 struct Voice {
18 bool spatialized : 1; ///< If the voice has spatialization data
19 bool chainedEvents : 1; ///< If this voice triggers events after it stopped playing
20 bool started : 1; ///< Whether the voice has started playing
21 bool audible : 1; ///< Whether the voice was heard by any listener
22 bool HRTF : 1; ///< If the voice should be rendered using hrtfs
23 bool loop : 1; ///< Voice will loop until killed
24 bool filtered : 1; ///< This will enable high/lowpass filters and variable speed playback. Gets turned on when signal does not match EngineStaticConfig::internalSampleRate
25 bool critical : 1; ///< Voice can't be killed in favor of new voice
26 bool attenuate : 1; ///< Whether distance affects volume
27 BankHandle bank; ///< Which bank it belongs to
28 SourceHandle source = InvalidSourceHandle; ///< If invalid, means voice is not playing.
29 EventHandle event; ///< Which event triggered the voice to be played
30 EmitterHandle emitter; ///< Emitter used to control voice properties
31 MixerHandle mixer; ///< Where the voice should mix to
32 ListenerHandle listener; ///< If it's spatialized it's rendered for this listener
33 Sample gain = 1.0; ///< Volume of the voice
34 SampleIndex time = 0; ///< Current time in samples
35 };
36
37 constexpr int _VAE_VOICE_SIZE = sizeof(Voice);
38} } // core::vae
39
40#endif // _VAE_VOICE
AudioBuffer::Size SampleIndex
Definition: vae_types.hpp:87
constexpr int _VAE_VOICE_SIZE
Definition: vae_voice.hpp:37
Contains Typedefinitions and basic structures use by the public API and internally.
Definition: vae.hpp:31
float Sample
Default sample types used where ever possible, changing this means the engine needs to be recompiled,...
Definition: vae.hpp:32
SmallHandle MixerHandle
Definition: vae.hpp:44
constexpr SourceHandle InvalidSourceHandle
Definition: vae.hpp:56
SmallHandle BankHandle
Definition: vae.hpp:40
SmallHandle ListenerHandle
Definition: vae.hpp:45
LargeHandle EmitterHandle
Definition: vae.hpp:43
GenericHandle EventHandle
The handle used to address events within a bank.
Definition: vae.hpp:41
GenericHandle SourceHandle
Definition: vae.hpp:42
Barebones voice.
Definition: vae_voice.hpp:17
SourceHandle source
If invalid, means voice is not playing.
Definition: vae_voice.hpp:28
bool spatialized
If the voice has spatialization data.
Definition: vae_voice.hpp:18
ListenerHandle listener
If it's spatialized it's rendered for this listener.
Definition: vae_voice.hpp:32
bool started
Whether the voice has started playing.
Definition: vae_voice.hpp:20
bool chainedEvents
If this voice triggers events after it stopped playing.
Definition: vae_voice.hpp:19
Sample gain
Volume of the voice.
Definition: vae_voice.hpp:33
EventHandle event
Which event triggered the voice to be played.
Definition: vae_voice.hpp:29
bool audible
Whether the voice was heard by any listener.
Definition: vae_voice.hpp:21
BankHandle bank
Which bank it belongs to.
Definition: vae_voice.hpp:27
bool filtered
This will enable high/lowpass filters and variable speed playback. Gets turned on when signal does no...
Definition: vae_voice.hpp:24
MixerHandle mixer
Where the voice should mix to.
Definition: vae_voice.hpp:31
bool critical
Voice can't be killed in favor of new voice.
Definition: vae_voice.hpp:25
EmitterHandle emitter
Emitter used to control voice properties.
Definition: vae_voice.hpp:30
bool loop
Voice will loop until killed.
Definition: vae_voice.hpp:23
bool HRTF
If the voice should be rendered using hrtfs.
Definition: vae_voice.hpp:22
SampleIndex time
Current time in samples.
Definition: vae_voice.hpp:34
bool attenuate
Whether distance affects volume.
Definition: vae_voice.hpp:26