#include <ICodec.hpp>
|
virtual | ~ICodec ()=default |
|
virtual int | encode (const std::int16_t *pcm, unsigned char *data)=0 |
| Encodes exactly one frame of audio data. More...
|
|
virtual int | encode (const float *pcm, unsigned char *data)=0 |
| same as Encode() with floats More...
|
|
virtual int | decode (const unsigned char *data, std::int16_t *pcm, std::int32_t dataSize)=0 |
| Decodes exactly one frame of audio data. More...
|
|
virtual int | decode (const unsigned char *data, float *pcm)=0 |
| Same as Decode() with floats. More...
|
|
virtual std::int32_t | getBitrate () const =0 |
| get the bitrate More...
|
|
virtual void | setBitrate (std::int32_t bitrate)=0 |
| Sets the bitrate. More...
|
|
virtual int | getChannel () const =0 |
| get the channels More...
|
|
virtual void | setChannel (int channel)=0 |
| sets the channel More...
|
|
virtual int | getApplication () const =0 |
| get the application type More...
|
|
virtual void | setApplication (int application)=0 |
| sets the Opus application mode Possible values are OPUS_APPLICATION_AUDIO (default) OPUS_APPLICATION_VOIP OPUS_APPLICATION_RESTRICTED_LOWDELAY More...
|
|
virtual int | getFrameSize () const =0 |
| get the frame size More...
|
|
virtual void | setFrameSize (int frameSize)=0 |
| sets the number of samples per channel Possible values are 120/480/960 (default)/1920/2880 More...
|
|
◆ ~ICodec()
virtual Babel::ICodec::~ICodec |
( |
| ) |
|
|
virtualdefault |
◆ decode() [1/2]
virtual int Babel::ICodec::decode |
( |
const unsigned char * |
data, |
|
|
float * |
pcm |
|
) |
| |
|
pure virtual |
Same as Decode() with floats.
Implemented in Babel::Opus.
◆ decode() [2/2]
virtual int Babel::ICodec::decode |
( |
const unsigned char * |
data, |
|
|
std::int16_t * |
pcm, |
|
|
std::int32_t |
dataSize |
|
) |
| |
|
pure virtual |
Decodes exactly one frame of audio data.
- Parameters
-
data | the frame to decode, can be nullptr in case of packet loss |
pcm | decoded data |
- Returns
- number of samples decoded
Implemented in Babel::Opus.
◆ encode() [1/2]
virtual int Babel::ICodec::encode |
( |
const float * |
pcm, |
|
|
unsigned char * |
data |
|
) |
| |
|
pure virtual |
same as Encode() with floats
Implemented in Babel::Opus.
◆ encode() [2/2]
virtual int Babel::ICodec::encode |
( |
const std::int16_t * |
pcm, |
|
|
unsigned char * |
data |
|
) |
| |
|
pure virtual |
Encodes exactly one frame of audio data.
- Parameters
-
pcm | the frame to encode |
data | encoded output |
Implemented in Babel::Opus.
◆ getApplication()
virtual int Babel::ICodec::getApplication |
( |
| ) |
const |
|
pure virtual |
◆ getBitrate()
virtual std::int32_t Babel::ICodec::getBitrate |
( |
| ) |
const |
|
pure virtual |
◆ getChannel()
virtual int Babel::ICodec::getChannel |
( |
| ) |
const |
|
pure virtual |
◆ getFrameSize()
virtual int Babel::ICodec::getFrameSize |
( |
| ) |
const |
|
pure virtual |
◆ setApplication()
virtual void Babel::ICodec::setApplication |
( |
int |
application | ) |
|
|
pure virtual |
sets the Opus application mode Possible values are OPUS_APPLICATION_AUDIO (default) OPUS_APPLICATION_VOIP OPUS_APPLICATION_RESTRICTED_LOWDELAY
Implemented in Babel::Opus.
◆ setBitrate()
virtual void Babel::ICodec::setBitrate |
( |
std::int32_t |
bitrate | ) |
|
|
pure virtual |
◆ setChannel()
virtual void Babel::ICodec::setChannel |
( |
int |
channel | ) |
|
|
pure virtual |
◆ setFrameSize()
virtual void Babel::ICodec::setFrameSize |
( |
int |
frameSize | ) |
|
|
pure virtual |
sets the number of samples per channel Possible values are 120/480/960 (default)/1920/2880
Implemented in Babel::Opus.
The documentation for this class was generated from the following file: