arduino-audio-tools
|
Decodes the provided data from the OSC segments. I recommend to assign a MultiDecoder so that we can support muiltiple audio types. More...
#include <ContainerOSC.h>
Public Member Functions | |
OSCContainerDecoder (AudioDecoder &decoder) | |
OSCContainerDecoder (MultiDecoder &decoder) | |
virtual void | addNotifyAudioChange (AudioInfoSupport &bi) |
Adds target to be notified about audio changes. | |
bool | addParserCallback (const char *address, bool(*callback)(OSCData &data, void *ref), OSCCompare compare=OSCCompare::Matches) |
Adds an new parser callback for a specific address matching string. | |
AudioInfo | audioInfo () override |
provides the actual input AudioInfo | |
virtual AudioInfo | audioInfoOut () |
bool | begin () |
virtual bool | begin (AudioInfo info) override |
virtual void | clearNotifyAudioChange () |
Deletes all change notify subscriptions. | |
void | end () |
Print * | getOutput () |
uint64_t | getSequenceNumber () |
Provides the sequence number of the last packet. | |
bool | isNotifyActive () |
Checks if the automatic AudioInfo update is active. | |
const char * | mime () |
Provides the mime type from the encoder. | |
operator bool () | |
virtual bool | removeNotifyAudioChange (AudioInfoSupport &bi) |
Removes a target in order not to be notified about audio changes. | |
void | setAudioInfo (AudioInfo from) override |
for most decoders this is not needed | |
virtual bool | setCodecConfig (const uint8_t *data, size_t len) |
Some decoders need e.g. a magic cookie to provide the relevant info for decoding. | |
void | setDecoder (AudioDecoder &decoder) |
Defines the decoder to be used. | |
void | setDecoder (MultiDecoder &decoder) |
Defines the decoder to be used: special logic for multidecoder. | |
void | setMissingDataCallback (void(*missing_data_callback)(uint64_t from_seq, uint64_t to_seq, void *ref)) |
Callback to be called when data is missing. | |
void | setNotifyActive (bool flag) |
Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
void | setOSCData (OSCData &osc) |
Optionally define you own OSCData object. | |
virtual void | setOutput (AudioOutput &out_stream) |
Defines where the decoded result is written to. | |
virtual void | setOutput (AudioStream &out_stream) |
Defines where the decoded result is written to. | |
void | setOutput (Print &outStream) |
Defines where the decoded result is written to. | |
void | setReference (void *ref) |
Provide a reference object to the callback. | |
void | setWriteCallback (bool(*write_callback)(uint64_t time, uint64_t seq, uint8_t *data, size_t len, void *ref)) |
Replace the write to the decoder with a callback: | |
size_t | write (const uint8_t *data, size_t len) |
Public Attributes | |
int | id |
custom id to be used by application | |
Protected Member Functions | |
void | notifyAudioChange (AudioInfo info) |
void | writeBlocking (Print *out, uint8_t *data, size_t len) |
Static Protected Member Functions | |
static void | missingDataCallback (uint64_t from_seq, uint64_t to_seq, void *ref) |
Default callback for missing data: just log the missing range. | |
static bool | parseData (OSCData &osc, void *ref) |
static bool | parseInfo (OSCData &osc, void *ref) |
Protected Attributes | |
SingleBuffer< uint8_t > | buffer {0} |
AudioInfo | info |
bool | is_active = false |
bool | is_multi_decoder = false |
bool | is_notify_active = true |
Str | mime_str |
void(* | missing_data_callback )(uint64_t from_seq, uint64_t to_seq, void *ref) = missingDataCallback |
Vector< AudioInfoSupport * > | notify_vector |
OSCData | osc_default |
AudioDecoder * | p_codec = nullptr |
OSCData * | p_osc = &osc_default |
Print * | p_out = nullptr |
Print * | p_print = nullptr |
void * | ref = nullptr |
uint64_t | seq_no = 0 |
bool(* | write_callback )(uint64_t time, uint64_t seq, uint8_t *data, size_t len, void *ref) = nullptr |
Return false to complete the processing w/o writing to the decoder. | |
Decodes the provided data from the OSC segments. I recommend to assign a MultiDecoder so that we can support muiltiple audio types.
|
inlinevirtualinherited |
Adds target to be notified about audio changes.
Reimplemented in CodecNOP, EncodedAudioOutput, EncodedAudioStream, AACDecoderFDK, DecoderBasic, MP3DecoderHelix, MP3DecoderMAD, OggContainerDecoder, Pipeline, and Pipeline::ModifyingStreamAdapter.
|
inlineoverridevirtualinherited |
provides the actual input AudioInfo
Implements AudioInfoSupport.
Reimplemented in CodecNOP, GGWaveDecoder, DecoderBasic, MP3DecoderHelix, MP3DecoderMAD, OpusAudioDecoder, WAVDecoder, WavIMADecoder, and OggContainerDecoder.
|
inlinevirtualinherited |
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 >.
|
inlinevirtual |
Reimplemented from AudioDecoder.
|
inlineoverridevirtualinherited |
Reimplemented from AudioWriter.
|
inlinevirtual |
Reimplemented from AudioDecoder.
|
inlinevirtual |
Implements AudioWriter.
|
inlineoverridevirtualinherited |
for most decoders this is not needed
Implements AudioWriter.
Reimplemented in GGWaveDecoder, DecoderALAC, DecoderL8, OpusAudioDecoder, CodecNOP, and G7xxDecoder.
|
inlinevirtualinherited |
Some decoders need e.g. a magic cookie to provide the relevant info for decoding.
Reimplemented in DecoderALAC, and MultiDecoder.
|
inlinevirtualinherited |
Defines where the decoded result is written to.
Reimplemented in ADTSDecoder, MTSDecoder, MTSDecoderTSDemux, and MetaDataFilterDecoder.
|
inlinevirtualinherited |
Defines where the decoded result is written to.
Reimplemented in ADTSDecoder, MTSDecoder, MTSDecoderTSDemux, and MetaDataFilterDecoder.
|
inlinevirtual |
Defines where the decoded result is written to.
Reimplemented from AudioDecoder.
|
inlinevirtual |
Implements AudioWriter.