arduino-audio-tools
|
A more natural Print class to process encoded data (aac, wav, mp3...). Just define the output and the decoder and write the encoded data. More...
#include <AudioEncoded.h>
Public Member Functions | |
EncodedAudioOutput (AudioDecoder *decoder) | |
EncodedAudioOutput (AudioEncoder *encoder) | |
EncodedAudioOutput (AudioOutput *outputStream, AudioDecoder *decoder) | |
EncodedAudioOutput (AudioOutput *outputStream, AudioEncoder *encoder) | |
EncodedAudioOutput (AudioStream *outputStream, AudioDecoder *decoder) | |
EncodedAudioOutput (AudioStream *outputStream, AudioEncoder *encoder) | |
EncodedAudioOutput (Print *outputStream, AudioDecoder *decoder) | |
EncodedAudioOutput (Print *outputStream, AudioEncoder *encoder) | |
void | addNotifyAudioChange (AudioInfoSupport &bi) override |
Define object which need to be notified if the basinfo is changing. | |
virtual AudioInfo | audioInfo () override |
provides the actual input AudioInfo | |
virtual AudioInfo | audioInfoOut () |
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream | |
int | availableForWrite () override |
bool | begin () override |
Starts the processing - sets the status to active. | |
virtual bool | begin (AudioInfo newInfo) |
Starts the processing - sets the status to active. | |
virtual void | clearNotifyAudioChange () |
Deletes all change notify subscriptions. | |
AudioDecoder & | decoder () |
Provides the initialized decoder. | |
AudioInfo | defaultConfig () |
AudioEncoder & | encoder () |
Provides the initialized encoder. | |
void | end () override |
Ends the processing. | |
virtual void | flush () |
AudioDecoder * | getDecoder () |
AudioEncoder * | getEncoder () |
bool | isCheckAvailableForWrite () |
Is Available for Write check activated ? | |
virtual bool | isDeletable () |
If true we need to release the related memory in the destructor. | |
bool | isNotifyActive () |
Checks if the automatic AudioInfo update is active. | |
operator bool () | |
Returns true if status is active and we still have data to be processed. | |
virtual bool | removeNotifyAudioChange (AudioInfoSupport &bi) |
Removes a target in order not to be notified about audio changes. | |
virtual void | setAudioInfo (AudioInfo newInfo) override |
Defines the input AudioInfo. | |
void | setDecoder (AudioDecoder *decoder) |
void | setEncoder (AudioEncoder *encoder) |
void | setFrameSize (int size) |
defines the size of the decoded frame in bytes | |
void | setNotifyActive (bool flag) |
Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
void | setOutput (Print &outputStream) |
Defines/Changes the output target. | |
void | setOutput (Print *outputStream) |
Defines the output. | |
virtual size_t | write (const uint8_t *data, size_t len) override |
encoder decode the data | |
virtual size_t | write (uint8_t ch) override |
virtual void | writeSilence (size_t len) |
Protected Member Functions | |
void | notifyAudioChange (AudioInfo info) |
Protected Attributes | |
int | _timeout = 10 |
bool | active = false |
AudioInfo | cfg |
bool | check_available_for_write = false |
AudioDecoder * | decoder_ptr = CodecNOP::instance() |
AudioEncoder * | encoder_ptr = CodecNOP::instance() |
int | frame_size = DEFAULT_BUFFER_SIZE |
bool | is_active = false |
bool | is_notify_active = true |
Vector< AudioInfoSupport * > | notify_vector |
Print * | ptr_out = nullptr |
SingleBuffer< uint8_t > | tmp {MAX_SINGLE_CHARS} |
int | tmpPos = 0 |
AudioWriter * | writer_ptr = nullptr |
A more natural Print class to process encoded data (aac, wav, mp3...). Just define the output and the decoder and write the encoded data.
|
inlineoverridevirtual |
Define object which need to be notified if the basinfo is changing.
Reimplemented from AudioInfoSource.
provides the actual input AudioInfo
Implements AudioInfoSupport.
Reimplemented in AdapterPrintToAudioOutput, and AdapterAudioStreamToAudioOutput.
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, and ResampleStream.
|
inlineoverridevirtual |
Reimplemented from AudioOutput.
|
inlineoverridevirtual |
Starts the processing - sets the status to active.
Reimplemented from AudioOutput.
Starts the processing - sets the status to active.
Reimplemented from AudioOutput.
|
inlineoverridevirtual |
Ends the processing.
Reimplemented from AudioOutput.
If true we need to release the related memory in the destructor.
Reimplemented in AdapterPrintToAudioOutput, and AdapterAudioStreamToAudioOutput.
Returns true if status is active and we still have data to be processed.
Reimplemented from AudioOutput.
Defines the input AudioInfo.
Reimplemented from AudioOutput.
Defines/Changes the output target.
Implements ModifyingOutput.
encoder decode the data
Implements AudioOutput.
Reimplemented in OversamplingDAC.
Writes n 0 values (= silence)
len |