|
arduino-audio-tools
|
Converter which converts bits_per_sample, channels and the sample_rate. The conversion is supported both on the input and output side. More...
#include <AudioStreamsConverter.h>
Public Member Functions | |
| FormatConverterStream ()=default | |
| FormatConverterStream (AudioOutput &print) | |
| FormatConverterStream (AudioStream &stream) | |
| FormatConverterStream (Print &print) | |
| FormatConverterStream (Stream &stream) | |
| virtual void | addNotifyAudioChange (AudioInfoSupport &bi) |
| Adds target to be notified about audio changes. | |
| virtual AudioInfo | audioInfo () override |
| provides the actual input AudioInfo | |
| AudioInfo | audioInfoOut () override |
| int | available () override |
| int | availableForWrite () override |
| bool | begin () override |
| (Re-)Starts the processing: call setAudioInfo and setAudioInfoOut before | |
| bool | begin (AudioInfo from) |
| Starts the processing: call setAudioInfoOut before to define the target. | |
| bool | begin (AudioInfo from, AudioInfo to) |
| virtual void | clearNotifyAudioChange () |
| Deletes all change notify subscriptions. | |
| void | end () |
| virtual void | flush () |
| float | getByteFactor () override |
| virtual Print * | getPrint () |
| virtual Stream * | getStream () |
| bool | isNotifyActive () |
| Checks if the automatic AudioInfo update is active. | |
| virtual | operator bool () |
| 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 info) override |
| Set the input audio information. | |
| void | setAudioInfoOut (AudioInfo to) |
| void | setBuffered (bool active) |
| Buffering is active by default to minimize the number of output calls. | |
| 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 &print) override |
| void | setOutput (Print &print) override |
| Defines/Changes the output target. | |
| void | setReadResultQueueSize (int size) |
| same as resizeReadResultQueue(size) | |
| void | setStream (AudioStream &io) override |
| void | setStream (Stream &io) override |
| Defines/Changes the input & output. | |
| void | setWriteBufferSize (int size) |
| virtual TransformationReader< ReformatBaseStream > & | transformationReader () |
| Provides access to the TransformationReader. | |
| virtual 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 () |
Converter which converts bits_per_sample, channels and the sample_rate. The conversion is supported both on the input and output side.
|
default |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtualinherited |
Adds target to be notified about audio changes.
Reimplemented in CodecNOP, EncodedAudioOutput, EncodedAudioStream, AACDecoderFDK, DecoderBasic, CodecChain, MP3DecoderHelix, MP3DecoderMAD, OggContainerDecoder, RTSPClient< TcpClient, UdpSocket >, Pipeline, and Pipeline::ModifyingStreamAdapter.
provides the actual input AudioInfo
Implements AudioInfoSupport.
Reimplemented in JupyterAudioT< T >, MozziStream, TimerCallbackAudioStream, EncodedAudioStream, PureDataStream, AdapterAudioOutputToAudioStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, and InputMerge< T >.
|
inlineoverridevirtual |
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
Reimplemented from AudioInfoSupport.
|
inlineoverridevirtualinherited |
Reimplemented from BaseStream.
|
inlineoverridevirtualinherited |
Reimplemented from BaseStream.
|
inlineoverridevirtual |
(Re-)Starts the processing: call setAudioInfo and setAudioInfoOut before
Reimplemented from BaseStream.
Starts the processing: call setAudioInfoOut before to define the target.
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inlinevirtual |
Reimplemented from BaseStream.
Called by TransformationReader when EOF is detected on the source stream. Override in subclasses to flush any internally buffered encoder/decoder data into the current output (which at that point is the result_queue). Do NOT call the full end()/begin() cycle here – that would destroy the reader's own buffers and reset the is_eof flag.
Reimplemented from BaseStream.
Reimplemented in ResampleStream, and EncodedAudioStream.
|
inlineoverridevirtual |
Implements ReformatBaseStream.
Reimplemented from AudioStream.
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 >.
Define the size of the interal read result queue: same as transformationReader().resizeResultQueue(size)
Set the input audio information.
Reimplemented from AudioStream.
Buffering is active by default to minimize the number of output calls.
Defines the read buffer size for individual reads: same as transformationReader().setMaxReadSize(size)
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
|
inlineoverridevirtual |
Reimplemented from ReformatBaseStream.
Defines/Changes the output target.
Reimplemented from ReformatBaseStream.
|
inlineoverridevirtual |
Reimplemented from ReformatBaseStream.
Defines/Changes the input & output.
Reimplemented from ReformatBaseStream.
|
inlineprotectedinherited |
|
inlinevirtualinherited |
Provides access to the TransformationReader.
Reimplemented from AudioStream.
Reimplemented in MemoryStream, AudioStreamWrapper, BufferedTaskStream, RingBufferStream, BufferedStream, and URLStream.
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |