Base class for AMR codec implementations.
More...
#include <AMRCodec.h>
|
virtual int | encode (const int16_t *pcmSamples, size_t sampleCount, uint8_t *amrData, size_t amrBufferSize)=0 |
| Encodes PCM audio samples to AMR format. More...
|
|
virtual int | decode (const uint8_t *amrData, size_t amrSize, int16_t *pcmSamples, size_t maxSampleCount)=0 |
| Decodes AMR format to PCM audio samples. More...
|
|
virtual int | getSampleRate () const =0 |
| Get sample rate used by the codec. More...
|
|
virtual int | getFrameSizeSamples ()=0 |
| Get the number of samples per frame. More...
|
|
virtual int | getEncodedFrameSizeBytes ()=0 |
| Get the size in bytes of one encoded frame. More...
|
|
|
bool | isInitialized = false |
|
Base class for AMR codec implementations.
◆ decode()
virtual int AMRCodec::decode |
( |
const uint8_t * |
amrData, |
|
|
size_t |
amrSize, |
|
|
int16_t * |
pcmSamples, |
|
|
size_t |
maxSampleCount |
|
) |
| |
|
pure virtual |
Decodes AMR format to PCM audio samples.
- Parameters
-
amrData | Input AMR encoded data |
amrSize | Size of AMR data in bytes |
pcmSamples | Output buffer for decoded PCM samples |
maxSampleCount | Maximum number of samples that can be written to pcmSamples |
- Returns
- Number of decoded samples
Implemented in AMRWB, and AMRNB.
◆ encode()
virtual int AMRCodec::encode |
( |
const int16_t * |
pcmSamples, |
|
|
size_t |
sampleCount, |
|
|
uint8_t * |
amrData, |
|
|
size_t |
amrBufferSize |
|
) |
| |
|
pure virtual |
Encodes PCM audio samples to AMR format.
- Parameters
-
pcmSamples | Input PCM audio samples |
sampleCount | Number of samples to encode |
amrData | Buffer to store encoded AMR data |
amrBufferSize | Size of the AMR buffer in bytes |
- Returns
- Number of bytes written to amrData
Implemented in AMRWB, and AMRNB.
◆ getEncodedFrameSizeBytes()
virtual int AMRCodec::getEncodedFrameSizeBytes |
( |
| ) |
|
|
pure virtual |
Get the size in bytes of one encoded frame.
- Returns
- Number of bytes for one encoded frame in current mode
Implemented in AMRWB, and AMRNB.
◆ getFrameSizeSamples()
virtual int AMRCodec::getFrameSizeSamples |
( |
| ) |
|
|
pure virtual |
Get the number of samples per frame.
- Returns
- NB: 160 samples/frame, WB: 320 samples/frame
Implemented in AMRWB, and AMRNB.
◆ getSampleRate()
virtual int AMRCodec::getSampleRate |
( |
| ) |
const |
|
pure virtual |
Get sample rate used by the codec.
- Returns
- Sample rate in Hz (8000 for NB, 16000 for WB)
Implemented in AMRWB, and AMRNB.
The documentation for this class was generated from the following file: