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, Hash aForNode)
 

Signals

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

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::AudioEncoder ( quint32  aSampleRate = 8000,
quint32  aNumChannels = 1 
)

Constructor.

◆ ~AudioEncoder()

AudioEncoder::~AudioEncoder ( )

Member Function Documentation

◆ frameEncoded

void AudioEncoder::frameEncoded ( quint32  aCallId,
quint32  aSeqNo,
const QByteArray &  aEncodedData,
Hash  aForNode 
)
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().
aForNodefingerprint of node supposed to receive the frame

◆ frameReady

void AudioEncoder::frameReady ( quint32  aCallId,
quint32  aSeqNo,
const QByteArray &  aAudioData,
Hash  aForNode 
)
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.
aForNodefingerprint of node supposed to receive the frame

Member Data Documentation

◆ iEncodedData

unsigned char* AudioEncoder::iEncodedData
private

◆ iEncoder

OpusEncoder* AudioEncoder::iEncoder
private

◆ iNumChannels

const quint32 AudioEncoder::iNumChannels
private

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