|
arduino-audio-tools
|
AAC Encoder based on the VisualOn vo-aacenc implementation (https://github.com/pschatzmann/codec-vo-aacenc). More...
#include <CodecAACVO.h>
Public Member Functions | |
| AACEncoderVO ()=default | |
| AACEncoderVO (Print &out_stream) | |
| ~AACEncoderVO () override | |
| AudioInfo | audioInfo () override |
| provides the actual input AudioInfo | |
| virtual AudioInfo | audioInfoOut () |
| bool | begin () override |
| bool | begin (AudioInfo info) override |
| VOAACEncoder * | driver () |
| 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 | setAdts (bool enabled) |
| Defines if ADTS headers are generated. | |
| void | setAudioInfo (AudioInfo from) override |
| Defines the sample rate, number of channels and bits per sample. | |
| void | setBitrate (uint32_t bps) |
| void | setOutput (Print &out_stream) override |
| Defines the output stream. | |
| void | setOutputBufferSize (size_t len) |
| Defines max encoded output frame size. | |
| size_t | write (const uint8_t *data, size_t len) override |
Protected Member Functions | |
| bool | encodeFrame () |
| void | writeBlocking (Print *out, uint8_t *data, size_t len) |
Static Protected Member Functions | |
| static uint32_t | defaultBitrate (uint32_t sample_rate, int channels) |
Protected Attributes | |
| bool | active = false |
| uint32_t | bitrate = 128000 |
| bool | bitrate_set = false |
| VOAACEncoder | enc |
| size_t | frame_bytes = 0 |
| AudioInfo | info |
| Vector< uint8_t > | out_buffer {0} |
| size_t | output_buffer_size = 2048 |
| Print * | p_print = nullptr |
| Vector< uint8_t > | pcm_buffer {0} |
| size_t | pcm_pos = 0 |
| bool | use_adts = true |
AAC Encoder based on the VisualOn vo-aacenc implementation (https://github.com/pschatzmann/codec-vo-aacenc).
The encoder consumes PCM in blocks of 1024 samples per channel, so this class buffers arbitrary write sizes and encodes full frames automatically.
|
default |
|
inline |
|
inlineoverride |
|
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.
|
inlineoverridevirtual |
Reimplemented from AudioWriter.
|
inlinestaticprotected |
Scales VOAAC_DEFAULT_BITRATE (defined for 16 bit stereo @ 44100 Hz) by sample rate and channel count.
|
inline |
|
inlineprotected |
|
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.
|
inlinevirtualinherited |
Optional rtsp function: provide samples per the frame.
Reimplemented in OpusAudioEncoder, OpusMultiStreamAudioEncoder, MP3EncoderShine, MP3ParserEncoder, and MetaDataFilterEncoder.
|
inline |
Defines if ADTS headers are generated.
|
inlineoverridevirtualinherited |
Defines the sample rate, number of channels and bits per sample.
Implements AudioWriter.
Reimplemented in MP3EncoderLAME, EncoderBasic, CodecChain, DSFEncoder, FLACEncoder, MP3EncoderShine, OpusAudioEncoder, OpusMultiStreamAudioEncoder, WAVEncoder, CodecNOP, G7xxEncoder, G729Encoder, BinaryContainerEncoder, OggContainerEncoder, OSCContainerEncoder, and MetaDataFilterEncoder.
|
inline |
Defines target bitrate in bps. If not called, the bitrate is derived from VOAAC_DEFAULT_BITRATE, scaled by the sample rate and channel count.
|
inlineoverridevirtual |
Defines the output stream.
Reimplemented from AudioEncoder.
|
inline |
Defines max encoded output frame size.
|
inlineoverridevirtual |
Implements AudioWriter.
|
inlineprotectedinherited |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |