arduino-audio-tools
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AnalogAudioStream Class Reference

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 <AnalogAudio.h>

Inheritance diagram for AnalogAudioStream:
AudioStream Stream AudioInfoSupport AudioInfoSource Print

Public Member Functions

 AnalogAudioStream ()=default
 Default constructor.
 
virtual ~AnalogAudioStream ()
 Destructor.
 
virtual AudioInfo audioInfo () override
 
int available () override
 
int availableForWrite () override
 
bool begin () override
 Reopen with last config.
 
bool begin (AnalogConfig cfg)
 starts the DAC
 
AnalogConfigconfig ()
 
AnalogConfig defaultConfig (RxTxMode mode=TX_MODE)
 Provides the default configuration.
 
AnalogDriverdriver ()
 Provides access to the driver.
 
void end () override
 stops the I2S and unistalls the analog
 
virtual void flush () override
 
 operator bool ()
 
size_t readBytes (uint8_t *dest, size_t size_bytes) override
 
virtual size_t readSilence (uint8_t *buffer, size_t length)
 Source to generate silence: just sets the buffer to 0.
 
virtual void setAudioInfo (AudioInfo info)
 updates the sample rate dynamically
 
virtual void setNotifyAudioChange (AudioInfoSupport &bi) override
 
virtual bool validate (AudioInfo &info)
 
size_t write (const uint8_t *src, size_t size_bytes) 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 refillReadBuffer ()
 

Protected Attributes

AnalogConfig adc_config
 
AnalogDriver analog
 
AudioInfo info
 
AudioInfoSupportp_notify =nullptr
 
RingBuffer< uint8_t > tmp_in {0}
 
RingBuffer< uint8_t > tmp_out {0}
 

Detailed Description

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.

Author
Phil Schatzmann

The documentation for this class was generated from the following file: