|
arduino-audio-tools
|
G.729 encoder using the bcg729 library. More...
#include <CodecG729.h>
Public Member Functions | |
| G729Encoder (bool is_vad_enabled=false) | |
| AudioInfo | audioInfo () override |
| provides the actual input AudioInfo | |
| virtual AudioInfo | audioInfoOut () |
| bool | begin () override |
| virtual bool | begin (AudioInfo info) |
| void | end () override |
| virtual uint32_t | frameDurationUs () |
| Optional rtsp function: provide the frame duration in microseconds. | |
| const char * | mime () override |
| Provides the mime type of the encoded result. | |
| operator bool () override | |
| virtual uint16_t | samplesPerFrame () |
| Optional rtsp function: provide samples per the frame. | |
| void | setAudioInfo (AudioInfo info) override |
| Defines the sample rate, number of channels and bits per sample. | |
| void | setOutput (Print &out_stream) override |
| Default output assignment (encoders may override to store Print reference) | |
| void | setVADEnabled (bool enabled) |
| size_t | write (const uint8_t *data, size_t len) override |
Protected Member Functions | |
| void | processByte (uint8_t byte) |
| void | writeBlocking (Print *out, uint8_t *data, size_t len) |
Protected Attributes | |
| size_t | buffer_pos = 0 |
| bcg729EncoderChannelContextStruct * | encoder_ctx = nullptr |
| AudioInfo | info |
| Vector< uint8_t > | input_buffer |
| bool | is_active = false |
| Print * | p_print = nullptr |
| Vector< uint8_t > | result_buffer |
| bool | vad_enabled = false |
G.729 encoder using the bcg729 library.
Accepts 16-bit PCM samples at 8 000 Hz (mono) and writes compressed G.729 frames to the configured output. Frames are produced every 80 input samples (10 ms):
VAD (Voice Activity Detection) is enabled by default; pass false to the constructor to disable it and always produce 10-byte speech frames.
Input must be exactly 8 000 Hz / mono / 16-bit PCM. Passing any other AudioInfo via setAudioInfo() logs an error and the fixed format is enforced.
Bitrate: 8 kbps (10 bytes × 8 bits/byte ÷ 0.01 s) which gives 1 kbytes/s Compression ratio: 16:1 (w/o SID frame)
|
inline |
|
inlineoverridevirtualinherited |
provides the actual input AudioInfo
Implements AudioInfoSupport.
Reimplemented in CodecNOP, BinaryContainerEncoder, and MP3ParserEncoder.
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
Reimplemented in PureDataStream, PWMAudioOutput, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FormatConverterStream, Pipeline, ResampleStream, and ResampleStreamT< TInterpolator >.
|
inlineoverridevirtual |
Implements AudioWriter.
Reimplemented in OggContainerEncoder, DecoderBasic, AudioDecoder, AACEncoderFDK, OggContainerDecoder, and MetaDataFilterEncoder.
|
inlineoverridevirtual |
Implements AudioWriter.
Optional rtsp function: provide the frame duration in microseconds.
Reimplemented in ADPCMEncoder, OpusOggEncoder, MP3ParserEncoder, and MetaDataFilterEncoder.
Provides the mime type of the encoded result.
Implements AudioEncoder.
Implements AudioWriter.
Optional rtsp function: provide samples per the frame.
Reimplemented in MP3ParserEncoder, and MetaDataFilterEncoder.
Defines the sample rate, number of channels and bits per sample.
Reimplemented from AudioEncoder.
Default output assignment (encoders may override to store Print reference)
Reimplemented from AudioEncoder.
Implements AudioWriter.
|
protected |
|
protected |
|
protectedinherited |