class

AudioGeneratorVoice

A generator wired into the AudioEngine as a custom data source, so its blocks take the normal route: bus / submix, volume, and 3D spatialization when SetSpatial(true). Mirrors MetaSoundVoice. The voice keeps the generator alive until it is uninitialized, so the audio thread never holds a dangling pointer; the caller may drop its own shared_ptr at any time.

Module
Audio
Header
#include "Audio/AudioGenerator.h"
Namespace
Mowo

Constructors

SignatureNameDescription
AudioGeneratorVoice()AudioGeneratorVoice
~AudioGeneratorVoice()~AudioGeneratorVoice
AudioGeneratorVoice(const AudioGeneratorVoice&) = deleteAudioGeneratorVoice

Public functions

ReturnsNameDescription
AudioGeneratorVoice&operator=
boolInitializeAttach a voice on bus rendering at the engine's sample rate.
voidShutdown
voidPlayPlay posts a Start (OnStart on the next block); Stop posts a Stop (OnStop on the next block, then silence).
voidStop
boolIsPlaying
voidSetVolume
voidSetSpatial
voidSetPosition
voidResetReset applied at the start of the next block.
std::shared_ptr<IAudioGenerator>GetGenerator

Function details

AudioGeneratorVoice

C++
AudioGeneratorVoice()

~AudioGeneratorVoice

C++
~AudioGeneratorVoice()

AudioGeneratorVoice

C++
AudioGeneratorVoice(const AudioGeneratorVoice&) = delete

operator=

C++
AudioGeneratorVoice& operator=(const AudioGeneratorVoice&) = delete

Initialize

C++
bool Initialize(std::shared_ptr<IAudioGenerator> generator, AudioBus bus = AudioBus::SFX, uint32_t channels = 2)

Attach a voice on bus rendering at the engine's sample rate. channels is what the generator writes (1..8); the engine converts it to the mix layout. Returns false when the engine is down or the generator is null.

Shutdown

C++
void Shutdown()

Play

C++
void Play()

Play posts a Start (OnStart on the next block); Stop posts a Stop (OnStop on the next block, then silence). The voice stays attached, so Play resumes it with no re-initialization.

Stop

C++
void Stop()

IsPlaying

C++
bool IsPlaying() const

SetVolume

C++
void SetVolume(float volume)

SetSpatial

C++
void SetSpatial(bool spatial)

SetPosition

C++
void SetPosition(float x, float y, float z)

Reset

C++
void Reset()

Reset applied at the start of the next block.

GetGenerator

C++
std::shared_ptr<IAudioGenerator> GetGenerator() const
Generated from Audio/AudioGenerator.h via audio.json · Dec 5, 2026Version 1.1.0