|
arduino-audio-tools
|
A more natural Stream class to process encoded data (aac, wav, mp3...) which also supports the decoding by calling readBytes(). More...
#include <AudioEncoded.h>
Public Member Functions | |
| EncodedAudioStream ()=default | |
| EncodedAudioStream (AudioDecoder *decoder) | |
| EncodedAudioStream (AudioEncoder *encoder) | |
| EncodedAudioStream (AudioOutput *outputStream, AudioDecoder *decoder) | |
| EncodedAudioStream (AudioStream *ioStream, AudioDecoder *decoder) | |
| EncodedAudioStream (Print *outputStream, AudioDecoder *decoder) | |
| EncodedAudioStream (Print *outputStream, AudioEncoder *encoder) | |
| EncodedAudioStream (Stream *ioStream, AudioDecoder *decoder) | |
| virtual | ~EncodedAudioStream () |
| void | addNotifyAudioChange (AudioInfoSupport &bi) override |
| Adds target to be notified about audio changes. | |
| AudioInfo | audioInfo () override |
| provides the actual input AudioInfo | |
| virtual AudioInfo | audioInfoOut () |
| int | available () override |
| int | availableForWrite () override |
| bool | begin () override |
| bool | begin (AudioInfo info) |
| 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 |
| void | flush () override |
| float | getByteFactor () override |
| approx compression factor: e.g. mp3 is around 4 | |
| AudioDecoder * | getDecoder () |
| AudioEncoder * | getEncoder () |
| virtual Print * | getPrint () |
| virtual Stream * | getStream () |
| bool | isNotifyActive () |
| Checks if the automatic AudioInfo update is active. | |
| virtual | operator bool () |
| EncodedAudioStream & | operator= (EncodedAudioStream const &src) |
| size_t | readBytes (uint8_t *data, size_t len) override |
| virtual size_t | readSilence (uint8_t *buffer, size_t length) |
| Source to generate silence: just sets the buffer to 0. | |
| virtual bool | removeNotifyAudioChange (AudioInfoSupport &bi) |
| Removes a target in order not to be notified about audio changes. | |
| void | resizeReadResultQueue (int size) |
| void | setAudioInfo (AudioInfo newInfo) override |
| Defines the input AudioInfo. | |
| void | setByteFactor (float factor) |
| Define the compression factor: e.g. mp3 is around 4. | |
| void | setDecoder (AudioDecoder *decoder) |
| void | setEncoder (AudioEncoder *encoder) |
| void | setFrameSize (int size) |
| defines the size of the decoded frame in bytes | |
| void | setMaxReadSize (int size) |
| Defines the read buffer size for individual reads: same as transformationReader().setMaxReadSize(size) | |
| void | setNotifyActive (bool flag) |
| Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
| void | setOutput (AudioOutput &stream) override |
| Defines/Changes the output target and registers for audio change notifications. | |
| void | setOutput (AudioOutput *stream) |
| void | setOutput (Print &out) override |
| Defines/Changes the output target. | |
| void | setOutput (Print *stream) |
| void | setReadResultQueueSize (int size) |
| same as resizeReadResultQueue(size) | |
| void | setStream (AudioStream &stream) override |
| Defines/Changes the input & output and registers for audio change notifications. | |
| void | setStream (AudioStream *stream) |
| void | setStream (Stream &stream) override |
| Defines/Changes the input & output. | |
| void | setStream (Stream *stream) |
| void | setWriteBufferSize (int size) |
| virtual TransformationReader< ReformatBaseStream > & | transformationReader () |
| Provides access to the TransformationReader. | |
| size_t | write (const uint8_t *data, size_t len) override |
| virtual size_t | write (uint8_t ch) override |
| virtual void | writeSilence (size_t len) |
| Writes len bytes of silence (=0). | |
Protected Member Functions | |
| virtual int | not_supported (int out, const char *msg="") |
| void | notifyAudioChange (AudioInfo info) |
| void | refillReadBuffer () |
| Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read() | |
| void | setupReader () |
Protected Attributes | |
| int | _timeout = 10 |
| float | byte_factor = 3.0f |
| EncodedAudioOutput | enc_out |
| AudioInfo | info |
| bool | is_notify_active = true |
| Vector< AudioInfoSupport * > | notify_vector |
| NullStream | null_stream |
| Print * | p_print = nullptr |
| Stream * | p_stream = nullptr |
| TransformationReader< ReformatBaseStream > | reader |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| int | write_buffer_size = MAX_SINGLE_CHARS |
A more natural Stream class to process encoded data (aac, wav, mp3...) which also supports the decoding by calling readBytes().
|
default |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
|
inlineoverridevirtual |
Adds target to be notified about audio changes.
Reimplemented from AudioInfoSource.
|
inlineoverridevirtual |
provides the actual input AudioInfo
Reimplemented from AudioStream.
|
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 >.
|
inlineoverridevirtualinherited |
Reimplemented from BaseStream.
|
inlineoverridevirtual |
Reimplemented from BaseStream.
|
inlineoverridevirtual |
Reimplemented from BaseStream.
|
inline |
|
inlinevirtualinherited |
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inline |
Provides the initialized decoder.
|
inline |
|
inline |
Provides the initialized encoder.
|
inlineoverridevirtual |
Reimplemented from BaseStream.
|
inlineoverridevirtual |
Flushes the encoder without tearing down the reader infrastructure. Called by TransformationReader on EOF so that final encoded bytes are written into the result_queue while it is still the active output.
Reimplemented from ReformatBaseStream.
|
inlineoverridevirtual |
approx compression factor: e.g. mp3 is around 4
Implements ReformatBaseStream.
|
inline |
|
inline |
|
inlinevirtualinherited |
|
inlinevirtualinherited |
|
inlineinherited |
Checks if the automatic AudioInfo update is active.
|
inlineprotectedvirtualinherited |
|
inlineprotectedinherited |
|
inlinevirtualinherited |
|
inline |
|
inlineoverridevirtual |
Reimplemented from AudioStream.
|
inlinevirtualinherited |
Source to generate silence: just sets the buffer to 0.
|
inlineprotectedinherited |
Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read()
|
inlinevirtualinherited |
Removes a target in order not to be notified about audio changes.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inlineinherited |
Define the size of the interal read result queue: same as transformationReader().resizeResultQueue(size)
|
inlineoverridevirtual |
Defines the input AudioInfo.
Reimplemented from AudioStream.
|
inline |
Define the compression factor: e.g. mp3 is around 4.
|
inline |
|
inline |
|
inline |
defines the size of the decoded frame in bytes
|
inlineinherited |
Defines the read buffer size for individual reads: same as transformationReader().setMaxReadSize(size)
|
inlineinherited |
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
|
inlineoverridevirtual |
Defines/Changes the output target and registers for audio change notifications.
Reimplemented from ReformatBaseStream.
|
inline |
|
inlineoverridevirtual |
Defines/Changes the output target.
Reimplemented from ReformatBaseStream.
|
inline |
|
inlineinherited |
same as resizeReadResultQueue(size)
|
inlineoverridevirtual |
Defines/Changes the input & output and registers for audio change notifications.
Reimplemented from ReformatBaseStream.
|
inline |
|
inlineoverridevirtual |
Defines/Changes the input & output.
Reimplemented from ReformatBaseStream.
|
inline |
|
inlineprotectedinherited |
|
inlineinherited |
|
inlinevirtualinherited |
Provides access to the TransformationReader.
|
inlineoverridevirtual |
Reimplemented from AudioStream.
|
inlineoverridevirtualinherited |
Reimplemented in MemoryStream, AudioStreamWrapper, BufferedTaskStream, RingBufferStream, BufferedStream, and URLStream.
|
inlinevirtualinherited |
Writes len bytes of silence (=0).
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |