|
arduino-audio-tools
|
Output Interface which processes PCM data by default using a VS1053 audio module. If you want to write encoded data set is_encoded_data = true in the configuration. Many VS1053 modules also have a built in microphone that can be used for recording: set the mode to RX_MODE to use this. More...
#include <VS1053Stream.h>
Public Member Functions | |
| VS1053Stream ()=default | |
| ~VS1053Stream () | |
| virtual void | addNotifyAudioChange (AudioInfoSupport &bi) |
| Adds target to be notified about audio changes. | |
| virtual AudioInfo | audioInfo () override |
| provides the actual input AudioInfo | |
| virtual AudioInfo | audioInfoOut () |
| virtual int | available () override |
| virtual int | availableForWrite () override |
| float | balance () |
| Get the currenet balance setting (-1.0..1.0) | |
| bool | begin () |
| Starts with the default config or restarts. | |
| bool | begin (VS1053Config cfg) |
| Starts with the indicated configuration. | |
| virtual void | clearNotifyAudioChange () |
| Deletes all change notify subscriptions. | |
| VS1053Config | defaultConfig (RxTxMode mode=TX_MODE) |
| Provides the default configuration for the indicated mod. | |
| void | end () |
| Stops the processing and releases the memory. | |
| virtual void | flush () override |
| VS1053 & | getVS1053 () |
| returns the VS1053 object | |
| bool | isNotifyActive () |
| Checks if the automatic AudioInfo update is active. | |
| virtual | operator bool () |
| virtual 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 | setAudioInfo (AudioInfo c) |
| Updates the AudioInfo (sample rate, bits, channels) | |
| void | setAudioInfo (VS1053Config c) |
| defines the default configuration that is used with the next begin() | |
| void | setBalance (float bal) |
| bool | setEncoder (AudioEncoder *enc) |
| void | setNotifyActive (bool flag) |
| Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
| bool | setVolume (float vol) override |
| value from 0 to 1.0 | |
| void | setWriteBufferSize (int size) |
| float | volume () override |
| provides the volume | |
| virtual size_t | write (const uint8_t *data, size_t len) override |
| Write audio data. | |
| virtual size_t | write (uint8_t ch) override |
| virtual void | writeSilence (size_t len) |
| Writes len bytes of silence (=0). | |
Protected Member Functions | |
| bool | beginTx () |
| void | logError (const char *str) |
| 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() | |
Protected Attributes | |
| int | _timeout = 10 |
| VS1053Config | cfg |
| CopyEncoder | copy |
| AudioInfo | info |
| bool | is_notify_active = true |
| Vector< AudioInfoSupport * > | notify_vector |
| AudioEncoder * | p_encoder = &wav |
| EncodedAudioStream * | p_out = nullptr |
| VS1053 * | p_vs1053 = nullptr |
| VS1053StreamOut * | p_vs1053_out = nullptr |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| float | volume_value = 1.0f |
| WAVEncoder | wav |
| int | write_buffer_size = MAX_SINGLE_CHARS |
Output Interface which processes PCM data by default using a VS1053 audio module. If you want to write encoded data set is_encoded_data = true in the configuration. Many VS1053 modules also have a built in microphone that can be used for recording: set the mode to RX_MODE to use this.
Depends on https://github.com/pschatzmann/arduino-vs1053
|
default |
|
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 >.
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 >.
Reimplemented from Stream.
Reimplemented in AudioKitStream, AudioLoRa, URLStreamBufferedT< T >, URLStreamBufferedT< ICYStream >, VBANStream, AudioStreamWrapper, LoRaStream, FaustStream< DSP >, AudioFFTBase, AudioMP34DT05, I2SCodecStream, MiniAudioStream, StdioStream, TfLiteAudioStream, A2DPStream, ESPNowStream, HammingFEC< bytecount, block_t >, HLSStreamT< URLStream >, HttpRequest, ICYStreamT< T >, URLStream, BufferedTaskStream, ReedSolomonFEC< bytecount, additional_bytes >, UDPStream, AnalogAudioArduino, AnalogAudioStream, AudioEffectStreamT< T >, Equalizer3Bands, Equalizer3BandsPerChannel, I2SStream, ReformatBaseStream, TimedStream, MemoryStream, RingBufferStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, BufferedStream, ConverterStream< T >, MeasuringStream, ProgressStream, Throttle, InputMerge< T >, CallbackStream, FilteredStream< T, TF >, FilteredStream< int16_t, int16_t >, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, CatStream, QueueStream< T >, QueueStream< uint8_t >, DynamicMemoryStream, FadeStream, FrequencyDetectorAutoCorrelation, FrequencyDetectorZeroCrossing, Pipeline, Pipeline::ModifyingStreamAdapter, VolumeStream, FileLoopT< FileType >, FileLoopT< File >, AudioBLEClient, AudioBLEClient, AudioBLEServer, and AudioBLEServer.
Reimplemented from Print.
Reimplemented in AudioLoRa, UDPStream, VBANStream, AudioStreamWrapper, ConverterStream< T >, LoRaStream, EncodedAudioStream, FaustStream< DSP >, AudioFFTBase, I2SCodecStream, MiniAudioStream, StdioStream, A2DPStream, ESPNowStream, HammingFEC< bytecount, block_t >, AbstractURLStream, URLStreamESP32, ReedSolomonFEC< bytecount, additional_bytes >, AnalogAudioArduino, AnalogAudioStream, AudioEffectStreamT< T >, Equalizer3Bands, Equalizer3BandsPerChannel, I2SStream, ReformatBaseStream, TimedStream, MemoryStream, RingBufferStream, MeasuringStream, ProgressStream, Throttle, FilteredStream< T, TF >, FilteredStream< int16_t, int16_t >, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, QueueStream< T >, QueueStream< uint8_t >, DynamicMemoryStream, FadeStream, FrequencyDetectorAutoCorrelation, FrequencyDetectorZeroCrossing, Pipeline, VolumeStream, AudioBLEClient, AudioBLEClient, AudioBLEServer, and AudioBLEServer.
|
inline |
Get the currenet balance setting (-1.0..1.0)
|
inlinevirtual |
Starts with the default config or restarts.
Reimplemented from BaseStream.
|
inline |
Starts with the indicated configuration.
|
inlineprotected |
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inline |
Provides the default configuration for the indicated mod.
|
inlinevirtual |
Stops the processing and releases the memory.
Reimplemented from BaseStream.
Reimplemented from Print.
Reimplemented in PureDataStream, URLStreamBufferedT< T >, URLStreamBufferedT< ICYStream >, AudioStreamWrapper, ResampleStream, URLStream, BufferedTaskStream, I2SStream, MemoryStream, RingBufferStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, and BufferedStream.
|
inline |
returns the VS1053 object
Implements BaseStream.
Reimplemented in LMSEchoCancellationStream< T >, MDFEchoCancellationStream< Allocator >, MozziStream, PureDataStream, AudioLoRa, URLStreamBufferedT< T >, URLStreamBufferedT< ICYStream >, AudioStreamWrapper, LoRaStream, EncodedAudioStream, FaustStream< DSP >, AudioFFTBase, AudioKitStream, AudioMP34DT05, I2SCodecStream, MiniAudioStream, PortAudioStream, TfLiteAudioStream, A2DPStream, AdaptiveResamplingStream, HLSStreamT< URLStream >, ICYStreamT< T >, URLStream, BufferedTaskStream, URLStreamESP32, VBANStream, AnalogAudioArduino, AnalogAudioStream, AudioEffectStreamT< T >, Equalizer3Bands, Equalizer3BandsPerChannel, I2SStream, ReformatBaseStream, TimedStream, MemoryStream, RingBufferStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, BufferedStream, ConverterStream< T >, MeasuringStream, ProgressStream, Throttle, InputMixer< T >, InputMerge< T >, CallbackStream, FilteredStream< T, TF >, FilteredStream< int16_t, int16_t >, VolumeMeter, AudioInputMonitor, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FadeStream, FrequencyDetectorAutoCorrelation, FrequencyDetectorZeroCrossing, GoertzelStream, Pipeline, VolumeStream, AudioBLEClient, AudioBLEClient, AudioBLEServer, AudioBLEServer, EqualizerNBands< SampleT, AccT, NUM_TAPS, NUM_BANDS >, WM8960Stream, AnalogDriverESP32V1::IO16Bit, and AnalogDriverESP32V2::IO16Bit.
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 >.
Updates the AudioInfo (sample rate, bits, channels)
Reimplemented from AudioStream.
|
inline |
defines the default configuration that is used with the next begin()
Adjusting the left and right volume balance, higher to enhance the right side, lower to enhance the left side.
|
inline |
Defines an alternative encoder that will be used (e.g. MP3Encoder). It must be allocated on the heap!
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
value from 0 to 1.0
Reimplemented from VolumeSupport.
|
inlineoverridevirtual |
provides the volume
Reimplemented from VolumeSupport.
Write audio data.
Reimplemented from AudioStream.
Reimplemented in MemoryStream, AudioStreamWrapper, BufferedTaskStream, RingBufferStream, BufferedStream, and URLStream.
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |