# OpalAudioMixer Class Reference

`#include <opalmixer.h>`

Inheritance diagram for OpalAudioMixer:

List of all members.

## Public Types

typedef std::string | Key_T
typedef std::map< Key_T, OpalAudioMixerStream * > | StreamInfoMap_T
typedef std::map< Key_T, OpalAudioMixerStream::StreamFrame > | MixerPCMMap_T

## Public Member Functions

| OpalAudioMixer (PBoolean realTime=PTrue, PBoolean _pushThread=PTrue)
virtual | ~OpalAudioMixer ()
virtual PBoolean | OnWriteAudio (const MixerFrame &)
PBoolean | AddStream (const Key_T &key, OpalAudioMixerStream *stream)
void | RemoveStream (const Key_T &key)
void | RemoveAllStreams ()
void | StartThread ()
void | ThreadMain ()
void | ReadRoutine ()
void | WriteMixedFrame ()
PBoolean | Write (const Key_T &key, const RTP_DataFrame &rtp)

## Protected Attributes

PINDEX | frameLengthMs
| size of each audio chunk in milliseconds
PMutex | mutex
| mutex for list of streams and thread handle
StreamInfoMap_T | streamInfoMap
| list of streams
unsigned | channelNumber
| counter for channels
PBoolean | realTime
| PTrue if realtime mixing.
PBoolean | pushThread
| PTrue if to use a thread to push data out.
PThread * | thread
| reader thread handle
PBoolean | threadRunning
| used to stop reader thread
PBoolean | audioStarted
| PTrue if output audio is running.
PBoolean | firstRead
| PTrue if first use of CheckForRead.
PTime | timeOfNextRead
| absolute timestamp for next scheduled read
DWORD | outputTimestamp
| RTP timestamp for output data.

## Classes

class | MixerFrame

## Member Typedef Documentation

typedef std::string OpalAudioMixer::Key_T

typedef std::map<Key_T, OpalAudioMixerStream *> OpalAudioMixer::StreamInfoMap_T

typedef std::map<Key_T, OpalAudioMixerStream::StreamFrame> OpalAudioMixer::MixerPCMMap_T

## Constructor & Destructor Documentation

OpalAudioMixer::OpalAudioMixer | ( | PBoolean | realTime = `PTrue`,
|  | PBoolean | _pushThread = `PTrue` |
| ) |  |  |

virtual OpalAudioMixer::~OpalAudioMixer | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

virtual PBoolean OpalAudioMixer::OnWriteAudio | ( | const MixerFrame & |  | ) | `[virtual]`

PBoolean OpalAudioMixer::AddStream | ( | const Key_T & | key,
|  | OpalAudioMixerStream * | stream |
| ) |  |  |

void OpalAudioMixer::RemoveStream | ( | const Key_T & | key | ) |

void OpalAudioMixer::RemoveAllStreams | ( |  | ) |

void OpalAudioMixer::StartThread | ( |  | ) |

void OpalAudioMixer::ThreadMain | ( |  | ) |

void OpalAudioMixer::ReadRoutine | ( |  | ) |

void OpalAudioMixer::WriteMixedFrame | ( |  | ) |

PBoolean OpalAudioMixer::Write | ( | const Key_T & | key,
|  | const RTP_DataFrame & | rtp |
| ) |  |  |

## Member Data Documentation

PINDEX OpalAudioMixer::frameLengthMs `[protected]`

size of each audio chunk in milliseconds

PMutex OpalAudioMixer::mutex `[protected]`

mutex for list of streams and thread handle

StreamInfoMap_T OpalAudioMixer::streamInfoMap `[protected]`

list of streams

unsigned OpalAudioMixer::channelNumber `[protected]`

counter for channels

PBoolean OpalAudioMixer::realTime `[protected]`

PTrue if realtime mixing.

PBoolean OpalAudioMixer::pushThread `[protected]`

PTrue if to use a thread to push data out.

PThread* OpalAudioMixer::thread `[protected]`

reader thread handle

PBoolean OpalAudioMixer::threadRunning `[protected]`

used to stop reader thread

PBoolean OpalAudioMixer::audioStarted `[protected]`

PTrue if output audio is running.

PBoolean OpalAudioMixer::firstRead `[protected]`

PTrue if first use of CheckForRead.

PTime OpalAudioMixer::timeOfNextRead `[protected]`

absolute timestamp for next scheduled read

DWORD OpalAudioMixer::outputTimestamp `[protected]`

RTP timestamp for output data.

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

- opalmixer.h