VAE - Virtual Audio Engine 1
Small Data Driven Audio Engine
vae::EngineConfig Struct Reference

Settings for the engine defined at EnginePimpl::init. More...

#include <vae.hpp>

Collaboration diagram for vae::EngineConfig:

Public Attributes

const char * rootPath = "./"
 Path where the bank files are located, needs to end with a trailing /. More...
 
Size internalSampleRate = 48000
 Samplerate requested from device. More...
 
EventCallback eventCallback = nullptr
 Each time a event of the type emit gets triggered Used to get information about ending sounds and similar. More...
 
void * eventCallbackContext = nullptr
 Custom data that can be accached to the EventCallback to maintain context. More...
 
Size preAllocatedEmitters = _preAllocatedEmitters
 How many emitters to allocate upfront. More...
 
Size voices = 512
 Hard limit on concurrent voices, can't be 0 or lower than hrtfVoices. More...
 
Size hrtfVoices = 16
 Amount of HRTF panned voices audible at any given time. More...
 
Size virtualVoices = _preAllocatedEmitters
 Hard limit on virtal voices. More...
 
Size finishedVoiceQueueSize = 1024
 Size of the voice queue for finished voices which need to trigger other events on_end when updating the engine. More...
 
Size preferredBufferSize = 512
 Buffer size that will be requested from device. More...
 
Size bufferPeriods = 3
 Number of blocks/buffers to processed ahead. More...
 
bool updateInAudioThread = false
 If this is true update() does not need to be called on the engine instance. More...
 
bool processInBufferSwitch = false
 If enabled, all processing and mixing will happen in the audio callback. More...
 

Static Public Attributes

static constexpr Size _preAllocatedEmitters = 1 << 14
 

Detailed Description

Settings for the engine defined at EnginePimpl::init.

Definition at line 157 of file vae.hpp.

Member Data Documentation

◆ _preAllocatedEmitters

constexpr Size vae::EngineConfig::_preAllocatedEmitters = 1 << 14
staticconstexpr

Definition at line 182 of file vae.hpp.

◆ bufferPeriods

Size vae::EngineConfig::bufferPeriods = 3

Number of blocks/buffers to processed ahead.

Increases latency but reduces chances of underruns since it's more forgiving to the scheduler.

Definition at line 240 of file vae.hpp.

◆ eventCallback

EventCallback vae::EngineConfig::eventCallback = nullptr

Each time a event of the type emit gets triggered Used to get information about ending sounds and similar.

Definition at line 174 of file vae.hpp.

◆ eventCallbackContext

void* vae::EngineConfig::eventCallbackContext = nullptr

Custom data that can be accached to the EventCallback to maintain context.

Definition at line 180 of file vae.hpp.

◆ finishedVoiceQueueSize

Size vae::EngineConfig::finishedVoiceQueueSize = 1024

Size of the voice queue for finished voices which need to trigger other events on_end when updating the engine.

Too low of a value can cause these events to be discarded.

Definition at line 223 of file vae.hpp.

◆ hrtfVoices

Size vae::EngineConfig::hrtfVoices = 16

Amount of HRTF panned voices audible at any given time.

Eats into the budget above.

Definition at line 209 of file vae.hpp.

◆ internalSampleRate

Size vae::EngineConfig::internalSampleRate = 48000

Samplerate requested from device.

If it doesn't support it, a resampler is used. Most of the audio samples used should be in this rate.

Definition at line 168 of file vae.hpp.

◆ preAllocatedEmitters

Size vae::EngineConfig::preAllocatedEmitters = _preAllocatedEmitters

How many emitters to allocate upfront.

Once this number is exceeded a reallocation will take place. This might cause a short audio dropout depending on the size. ! internal map allocates power of 2 sizes ! This makes space for 16384 emitters. Having less emitters than amount of voices does't make too much sense since each voice will have one assigned. Unless one emitter triggers a lot of sounds.

Definition at line 194 of file vae.hpp.

◆ preferredBufferSize

Size vae::EngineConfig::preferredBufferSize = 512

Buffer size that will be requested from device.

Higher values increase latency but reduce chanes of crackles and other artefacts. Some audio backends need higher values to work properly. The actual buffer size might vary based on the device.

Definition at line 233 of file vae.hpp.

◆ processInBufferSwitch

bool vae::EngineConfig::processInBufferSwitch = false

If enabled, all processing and mixing will happen in the audio callback.

This results in lower latency and one less thread running, but this isn't good practice apparently.

Definition at line 256 of file vae.hpp.

◆ rootPath

const char* vae::EngineConfig::rootPath = "./"

Path where the bank files are located, needs to end with a trailing /.

Definition at line 161 of file vae.hpp.

◆ updateInAudioThread

bool vae::EngineConfig::updateInAudioThread = false

If this is true update() does not need to be called on the engine instance.

This means events will be emitted more offen and if a lot of work is done in the EventCallback defined above, the audio thread will be blocked and underruns occur.

Definition at line 248 of file vae.hpp.

◆ virtualVoices

Size vae::EngineConfig::virtualVoices = _preAllocatedEmitters

Hard limit on virtal voices.

Virtualized voices will be revived as soon as possible and retain their playback position.

Definition at line 216 of file vae.hpp.

◆ voices

Size vae::EngineConfig::voices = 512

Hard limit on concurrent voices, can't be 0 or lower than hrtfVoices.

Rendering 512 voices with filters and spatialization is probably pushing it for most situations and not even necessary. This is a few years old but AudioKinetic recommends something around a 100 https://blog.audiokinetic.com/how-to-get-a-hold-on-your-voices-optimizing-for-cpu-part-1/

Definition at line 203 of file vae.hpp.


The documentation for this struct was generated from the following file: