|
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, MP3EncoderShine, BinaryContainerEncoder, and MP3ParserEncoder.
|
inlinevirtualinherited |
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
Reimplemented in MP3EncoderShine, PureDataStream, PWMAudioOutput< PWMDriverT >, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FormatConverterStream, Pipeline, ResampleStream, and ResampleStreamT< TInterpolator >.
|
inlineoverridevirtual |
Implements AudioWriter.
|
inlinevirtualinherited |
Reimplemented in OpusOggEncoder, OggContainerEncoder, DecoderBasic, AudioDecoder, AACEncoderFDK, AACEncoderVO, OggContainerDecoder, and MetaDataFilterEncoder.
|
inlineoverridevirtual |
Implements AudioWriter.
|
inlinevirtualinherited |
Optional rtsp function: provide the frame duration in microseconds.
Reimplemented in ADPCMEncoder, MP3EncoderShine, OpusOggEncoder, MP3ParserEncoder, and MetaDataFilterEncoder.
|
inlineoverridevirtual |
Provides the mime type of the encoded result.
Implements AudioEncoder.
|
inlineoverridevirtual |
Implements AudioWriter.
|
inlineprotected |
|
inlinevirtualinherited |
Optional rtsp function: provide samples per the frame.
Reimplemented in OpusAudioEncoder, OpusMultiStreamAudioEncoder, MP3EncoderShine, MP3ParserEncoder, and MetaDataFilterEncoder.
|
inlineoverridevirtual |
Defines the sample rate, number of channels and bits per sample.
Reimplemented from AudioEncoder.
|
inlineoverridevirtual |
Default output assignment (encoders may override to store Print reference)
Reimplemented from AudioEncoder.
|
inline |
|
inlineoverridevirtual |
Implements AudioWriter.
|
inlineprotectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |