VAE - Virtual Audio Engine 1
Small Data Driven Audio Engine
vae_source.hpp
Go to the documentation of this file.
1#ifndef _VAE_SOURCE
2#define _VAE_SOURCE
3
4#include "../vae_types.hpp"
5
6#include <stddef.h>
7
8namespace vae { namespace core {
9 struct Source {
11 bool stream : 1; ///< If false entire sample will be loaded in ram, there's no streaming for now
12 bool resample : 1; ///< Whether the sound will be resampled when loading it
13 bool raw : 1; ///< The data in path is a data buffer
14 enum class Format {
15 wav, ///< Uses dr_wav to decode wavs
16 ogg, ///< Uses stb_vorbis to decode oggs
17 generator ///< Not implemented
18 } format : 2;
19
20 Sample gain; ///< Gain applied to every voice creatd frin this source
21 AudioBuffer signal; ///< Audio signal itself loaded by SourceLoader
22 PathString path; ///< Filesystem path
23 NameString name; ///< Name for debugging
24
26 stream = false;
27 resample = false;
28 gain = 1.0;
30 raw = false;
31 }
32 };
33
34 constexpr int _VAE_BUF_SIZE = sizeof(AudioBuffer);
35 constexpr int _VAE_SOURCE_SIZE = sizeof(Source);
36} } // namespace vae::vore
37
38#endif // _VAE_SOURCE
constexpr int _VAE_BUF_SIZE
Definition: vae_source.hpp:34
tklb::AudioBufferTpl< Sample, tklb::HeapBuffer< Sample, tklb::DEFAULT_ALIGNMENT, memory::AllocatorAudio< unsigned char > > > AudioBuffer
Buffer type to hold all the audio data meant for playback.
Definition: vae_types.hpp:70
constexpr int _VAE_SOURCE_SIZE
Definition: vae_source.hpp:35
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
constexpr SourceHandle InvalidSourceHandle
Definition: vae.hpp:56
GenericHandle SourceHandle
Definition: vae.hpp:42
AudioBuffer signal
Audio signal itself loaded by SourceLoader.
Definition: vae_source.hpp:21
bool stream
If false entire sample will be loaded in ram, there's no streaming for now.
Definition: vae_source.hpp:11
@ ogg
Uses stb_vorbis to decode oggs.
@ wav
Uses dr_wav to decode wavs.
@ generator
Not implemented.
PathString path
Filesystem path.
Definition: vae_source.hpp:22
bool resample
Whether the sound will be resampled when loading it.
Definition: vae_source.hpp:12
enum vae::core::Source::Format format
NameString name
Name for debugging.
Definition: vae_source.hpp:23
Sample gain
Gain applied to every voice creatd frin this source.
Definition: vae_source.hpp:20
SourceHandle id
Definition: vae_source.hpp:10
bool raw
The data in path is a data buffer.
Definition: vae_source.hpp:13