Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::audio::Mixer Class Reference

Mixer. Mixes multiple input streams into one output stream. More...

#include <mixer.h>

Inheritance diagram for roc::audio::Mixer:
Collaboration diagram for roc::audio::Mixer:

Public Member Functions

 Mixer (core::BufferPool< sample_t > &pool, size_t frame_size)
 Initialize. More...
 
bool valid () const
 Check if the mixer was succefully constructed. More...
 
void add (IReader &)
 Add input reader. More...
 
void remove (IReader &)
 Remove input reader. More...
 
virtual void read (Frame &frame)
 Read audio frame. More...
 
- Public Member Functions inherited from roc::core::ListNode
ListNodeDatalist_node_data () const
 Get list node data. More...
 

Detailed Description

Mixer. Mixes multiple input streams into one output stream.

For example, these two input streams:

1, 2, 3, ...
4, 5, 6, ...

are transformed into this output stream:

5, 7, 9, ...

Definition at line 38 of file mixer.h.

Constructor & Destructor Documentation

roc::audio::Mixer::Mixer ( core::BufferPool< sample_t > &  pool,
size_t  frame_size 
)
explicit

Initialize.

Parameters

  • pool is used to allocate a temporary buffer of samples
  • frame_size defines the temporary buffer size used to read from attached readers

Member Function Documentation

void roc::audio::Mixer::add ( IReader )

Add input reader.

virtual void roc::audio::Mixer::read ( Frame frame)
virtual

Read audio frame.

Remarks
Reads samples from every input reader, mixes them, and fills frame with the result.

Implements roc::audio::IReader.

void roc::audio::Mixer::remove ( IReader )

Remove input reader.

bool roc::audio::Mixer::valid ( ) const

Check if the mixer was succefully constructed.


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