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 <AnalogAudio.h>
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 | |
AnalogConfig & | config () |
AnalogConfig | defaultConfig (RxTxMode mode=TX_MODE) |
Provides the default configuration. | |
AnalogDriver * | driver () |
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 |
AudioInfoSupport * | p_notify =nullptr |
RingBuffer< uint8_t > | tmp_in {0} |
RingBuffer< uint8_t > | tmp_out {0} |
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.