Skip to content

AAudioMixer#

Manages audio players and mixes them into one sound stream.

Header:#include <AUI/Audio/AAudioMixer.h>
CMake:aui_link(my_target PUBLIC aui::audio)

Detailed Description#

Experimental Feature

This API is experimental. Experimental APIs are likely to contain bugs, might be changed or removed in the future.

Public Methods#

addSoundSource#


void AAudioMixer::addSoundSource(aui::non_null<_<IAudioPlayer> > s)

Add new sound source for mixing

Arguments
s
New sound source

readSoundData#


std::size_t AAudioMixer::readSoundData(std::span<std::byte> destination)

Write mixed audio data into buffer.

Arguments
destination
Pre-allocated buffer to write into
Returns
Number of bytes written

removeSoundSource#


void AAudioMixer::removeSoundSource(aui::non_null<_<IAudioPlayer> > s)

Remove sound source if it is represented in list of added sound sources, otherwise do nothing

Arguments
s
Sound source to remove