![]() |
Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Mixer. Mixes multiple input streams into one output stream. More...
#include <mixer.h>
Public Member Functions | |
Mixer (core::BufferFactory< sample_t > &buffer_factory, core::nanoseconds_t frame_length, const audio::SampleSpec &sample_spec) | |
Initialize. | |
bool | valid () const |
Check if the mixer was succefully constructed. | |
void | add_input (IFrameReader &) |
Add input reader. | |
void | remove_input (IFrameReader &) |
Remove input reader. | |
virtual bool | read (Frame &frame) |
Read audio frame. | |
virtual bool | read (Frame &frame)=0 |
Read audio frame. | |
![]() | |
ListNodeData * | list_node_data () const |
Get list node data. | |
Mixer. Mixes multiple input streams into one output stream.
For example, these two input streams:
are transformed into this output stream:
roc::audio::Mixer::Mixer | ( | core::BufferFactory< sample_t > & | buffer_factory, |
core::nanoseconds_t | frame_length, | ||
const audio::SampleSpec & | sample_spec | ||
) |
Initialize.
Parameters
buffer_factory
is used to allocate a temporary buffer of samplesframe_length
defines the temporary buffer length used to read from, in nanosecondssample_spec
defines the sample spec taken from the audio signal void roc::audio::Mixer::add_input | ( | IFrameReader & | ) |
Add input reader.
|
virtual |
Read audio frame.
frame
with the result. Implements roc::audio::IFrameReader.
void roc::audio::Mixer::remove_input | ( | IFrameReader & | ) |
Remove input reader.
bool roc::audio::Mixer::valid | ( | ) | const |
Check if the mixer was succefully constructed.