Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
WM8960Stream Class Reference

Stream for reading and writing audio data using the WM8960 Codec Chip You need to install More...

#include <WM8960Stream.h>

Inheritance diagram for WM8960Stream:
AudioStream Stream AudioBaseInfoDependent AudioBaseInfoSource Print

Public Member Functions

virtual AudioBaseInfo audioInfo () override
virtual int available () override
virtual int availableForWrite () override
bool begin ()
 Starts with the default config or restarts.
bool begin (WM8960Config config)
 Starts with the indicated configuration.
WM8960Config defaultConfig (RxTxMode mode=TX_MODE)
void end ()
 Stops the processing and releases the memory.
virtual void flush () override
 operator bool ()
size_t readBytes (uint8_t *data, size_t size) override
void setAudioInfo (AudioBaseInfo c)
void setAudioInfo (WM8960Config c)
 defines the default configuration that is used with the next begin()
virtual void setNotifyAudioChange (AudioBaseInfoDependent &bi) override
void setVolume (float vol)
 Sets both input and output volume value (from 0 to 1.0)
void setVolumeIn (float vol)
void setVolumeOut (float vol)
virtual bool validate (AudioBaseInfo &info)
float volumeIn ()
 provides the volume
float volumeOut ()
size_t write (const uint8_t *data, size_t size) override
virtual size_t write (uint8_t ch) override
virtual void writeSilence (size_t len)

Protected Member Functions

void adjustInputVolume (float vol)
bool configure_clocking ()
bool init (RxTxMode mode)
mtb_wm8960_mode_t modeMasterSlave (bool microcontroller_is_master)
 if microcontroller is master then module is slave
virtual int not_supported (int out, const char *msg="")
void refillReadBuffer ()
mtb_wm8960_adc_dac_sample_rate_t sampleRate (int rate)
void setOutputVolume (float vol)
void volumeError (float vol)
mtb_wm8960_word_length_t wordLength (int bits)

Protected Attributes

WM8960Config cfg
I2SStream i2s
AudioBaseInfo info
AudioBaseInfoDependentp_notify =nullptr
RingBuffer< uint8_t > tmp_in {0}
RingBuffer< uint8_t > tmp_out {0}
float volume_in
float volume_out

Detailed Description

Stream for reading and writing audio data using the WM8960 Codec Chip You need to install

Phil Schatzmann

Member Function Documentation

◆ writeSilence()

virtual void writeSilence ( size_t  len)

Writes len bytes of silence (=0).


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