|
arduino-audio-tools
|
Encoder for Opus multistream audio. Supports up to 255 channels by combining multiple Opus streams into a single packet. Each fully encoded frame is written to the output stream. More...
#include <CodecOpusMultiStream.h>
Public Member Functions | |
| OpusMultiStreamAudioEncoder ()=default | |
| OpusMultiStreamAudioEncoder (Print &out) | |
| AudioInfo | audioInfo () override |
| provides the actual input AudioInfo | |
| virtual AudioInfo | audioInfoOut () |
| bool | begin () override |
| virtual bool | begin (AudioInfo info) |
| bool | begin (OpusMultiStreamEncoderSettings settings) |
| OpusMultiStreamEncoderSettings & | config () |
| OpusMultiStreamEncoderSettings & | defaultConfig () |
| void | end () override |
| virtual uint32_t | frameDurationUs () |
| Optional rtsp function: provide the frame duration in microseconds. | |
| virtual int | frameSize () |
| int | frameSizeSamples () |
| bool | isOpen () |
| int | lookaheadSamples () |
| const char * | mime () override |
| Provides the mime type of the encoded result. | |
| operator bool () override | |
| int | pendingSamples () |
| uint16_t | samplesPerFrame () |
| Optional rtsp function: provide samples per the frame. | |
| void | setAudioInfo (AudioInfo from) 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) | |
| size_t | write (const uint8_t *data, size_t len) override |
Protected Member Functions | |
| void | encodeByte (uint8_t data) |
| void | encodeFrame () |
| int | getFrameSizeSamples (int sampling_rate) |
| bool | settings () |
| void | writeBlocking (Print *out, uint8_t *data, size_t len) |
Protected Attributes | |
| OpusMultiStreamEncoderSettings | cfg |
| OpusMSEncoder * | enc = nullptr |
| Vector< uint8_t > | frame {0} |
| int | frame_pos = 0 |
| AudioInfo | info |
| bool | is_open = false |
| Print * | p_print = nullptr |
| Vector< uint8_t > | packet {0} |
Encoder for Opus multistream audio. Supports up to 255 channels by combining multiple Opus streams into a single packet. Each fully encoded frame is written to the output stream.
Depends on https://github.com/pschatzmann/codec-opus.git
|
default |
|
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, ResampleStreamT< TInterpolator >, and SupportedRatesStream.
|
inlineoverridevirtual |
Implements AudioWriter.
|
inlinevirtualinherited |
Reimplemented in OpusOggEncoder, OggContainerEncoder, DecoderBasic, AudioDecoder, AACEncoderFDK, AACEncoderVO, OggContainerDecoder, and MetaDataFilterEncoder.
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inlineprotected |
|
inlineoverridevirtual |
Implements AudioWriter.
|
inlinevirtualinherited |
Optional rtsp function: provide the frame duration in microseconds.
Reimplemented in ADPCMEncoder, MP3EncoderShine, OpusOggEncoder, MP3ParserEncoder, and MetaDataFilterEncoder.
|
inlinevirtualinherited |
Optional rtsp function: provide the encoded size (in bytes) of one frame, once known (e.g. after the encoder has seen real data). Lets an RTSPFormat size its RTP fragments to match one frame instead of a fixed guess, so throughput actually tracks frameDurationUs() - a fragment size covering several frames' worth of bytes sent at one-frame timing overruns real-time bandwidth and, over UDP (no flow control), causes packet loss. Returns 0 if not yet known/not applicable (fixed-frame-size codecs have no need to override this).
Reimplemented in ADPCMEncoder, EncoderALAC, AMRNBEncoder, AMRWBEncoder, and MP3ParserEncoder.
|
inline |
|
inlineprotected |
|
inline |
|
inline |
|
inlineoverridevirtual |
Provides the mime type of the encoded result.
Implements AudioEncoder.
|
inlineoverridevirtual |
Implements AudioWriter.
|
inline |
|
inlinevirtual |
Optional rtsp function: provide samples per the frame.
Reimplemented from AudioEncoder.
|
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.
|
inlineprotected |
|
inlineoverridevirtual |
Implements AudioWriter.
|
inlineprotectedinherited |
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protected |
|
protected |
|
protected |