|
arduino-audio-tools
|
ESP32: A very fast ADC and DAC using the ESP32 I2S interface. For all other architectures we support reading of audio only using analog input with a timer. More...
#include <AnalogAudioStream.h>
Public Member Functions | |
| AnalogAudioStream ()=default | |
| Default constructor. | |
| AnalogAudioStream (AnalogDriverBase &driver) | |
| Constructor to define a custom driver. | |
| virtual | ~AnalogAudioStream () |
| Destructor. | |
| 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 () |
| int | available () override |
| int | availableForWrite () override |
| bool | begin () override |
| Reopen with last config. | |
| bool | begin (AnalogConfig cfg) |
| starts the DAC | |
| virtual void | clearNotifyAudioChange () |
| Deletes all change notify subscriptions. | |
| AnalogConfig & | config () |
| AnalogConfig | defaultConfig (RxTxMode mode=TX_MODE) |
| Provides the default configuration. | |
| AnalogDriverBase * | driver () |
| Provides access to the driver. | |
| void | end () override |
| stops the I2S and unistalls the analog | |
| virtual void | flush () override |
| 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. | |
| virtual void | setAudioInfo (AudioInfo info) |
| updates the sample rate dynamically | |
| void | setNotifyActive (bool flag) |
| Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
| void | setWriteBufferSize (int size) |
| size_t | write (const uint8_t *data, size_t len) override |
| ESP32 only: writes the data to the I2S interface. | |
| 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() | |
Protected Attributes | |
| int | _timeout = 10 |
| AnalogConfig | adc_config |
| AnalogDriver | default_analog |
| AudioInfo | info |
| bool | is_notify_active = true |
| Vector< AudioInfoSupport * > | notify_vector |
| AnalogDriverBase * | p_analog = &default_analog |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| int | write_buffer_size = MAX_SINGLE_CHARS |
ESP32: A very fast ADC and DAC using the ESP32 I2S interface. For all other architectures we support reading of audio only using analog input with a timer.
|
default |
Default constructor.
|
inline |
Constructor to define a custom driver.
|
inlinevirtual |
Destructor.
|
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 >.
|
inlineoverridevirtual |
Reimplemented from BaseStream.
|
inlineoverridevirtual |
Reimplemented from BaseStream.
|
inlineoverridevirtual |
Reopen with last config.
Reimplemented from BaseStream.
|
inline |
starts the DAC
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inline |
|
inline |
Provides the default configuration.
|
inline |
Provides access to the driver.
|
inlineoverridevirtual |
stops the I2S and unistalls the analog
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.
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 >.
updates the sample rate dynamically
Reimplemented from AudioStream.
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
ESP32 only: writes the data to the I2S interface.
Reimplemented from AudioStream.
Reimplemented in MemoryStream, AudioStreamWrapper, BufferedTaskStream, RingBufferStream, BufferedStream, and URLStream.
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |