Classified ads
Public Slots | Signals | Public Member Functions | Private Attributes | List of all members
AudioEncoder Class Reference

class for compressing audio to be sent over network More...

#include <audioencoder.h>

Inheritance diagram for AudioEncoder:
Inheritance graph
[legend]
Collaboration diagram for AudioEncoder:
Collaboration graph
[legend]

Public Slots

void frameReady (quint32 aCallId, quint32 aSeqNo, const QByteArray &aAudioData)
 

Signals

void frameEncoded (quint32 aCallId, quint32 aSeqNo, const QByteArray &aEncodedData)
 

Public Member Functions

 AudioEncoder (quint32 aSampleRate=8000, quint32 aNumChannels=1)
 
 ~AudioEncoder ()
 

Private Attributes

OpusEncoder * iEncoder
 
unsigned char * iEncodedData
 
const quint32 iNumChannels
 

Detailed Description

class for compressing audio to be sent over network

This class encapsulates opus encoder for packing audio over network. Future releases may include other options regarding the codec or type of input (audio/video/feeling/touch/smell/other?)

Constructor & Destructor Documentation

AudioEncoder::AudioEncoder ( quint32  aSampleRate = 8000,
quint32  aNumChannels = 1 
)

Constructor.

AudioEncoder::~AudioEncoder ( )

Member Function Documentation

void AudioEncoder::frameEncoded ( quint32  aCallId,
quint32  aSeqNo,
const QByteArray &  aEncodedData 
)
signal

This signal is emitted after audio frame has been encoded into opus format. When audio data is sent in via slot frameReady then this signal is emitted as result of succesful processing.

Parameters
aCallIdcall identifer of the audio stream
aSeqNosequence number of frame inside stream
aEncodedDataraw opus frame, as it comes out from opus library call opus_encode_float().
void AudioEncoder::frameReady ( quint32  aCallId,
quint32  aSeqNo,
const QByteArray &  aAudioData 
)
slot

Input to encoder cames in via this method.

Parameters
aCallIdcall identifer of the audio stream
aSeqNosequence number of frame inside stream
aAudioDataraw, unpacked audio samples. The byte-array must contain an array of floats in [-1,1] range.

Member Data Documentation

unsigned char* AudioEncoder::iEncodedData
private
OpusEncoder* AudioEncoder::iEncoder
private
const quint32 AudioEncoder::iNumChannels
private

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