|
arduino-audio-tools
|
Stream for reading and writing audio data using the WM8960 Codec Chip You need to install https://github.com/pschatzmann/arduino-wm8960. More...
#include <WM8960Stream.h>
Public Member Functions | |
| WM8960Stream ()=default | |
| 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 |
| bool | begin () |
| Starts with the default config or restarts. | |
| bool | begin (WM8960Config config) |
| Starts with the indicated configuration. | |
| virtual void | clearNotifyAudioChange () |
| Deletes all change notify subscriptions. | |
| WM8960Config | defaultConfig (RxTxMode mode=TX_MODE) |
| void | end () |
| Stops the processing and releases the memory. | |
| 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 size) 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) |
| Defines the input AudioInfo. | |
| void | setAudioInfo (WM8960Config c) |
| defines the default configuration that is used with the next begin() | |
| void | setNotifyActive (bool flag) |
| Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
| bool | setVolume (float vol) |
| Sets both input and output volume value (from 0 to 1.0) | |
| void | setVolumeIn (float vol) |
| void | setVolumeOut (float vol) |
| void | setWriteBufferSize (int size) |
| 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) |
| Writes len bytes of silence (=0). | |
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 | notifyAudioChange (AudioInfo info) |
| void | refillReadBuffer () |
| Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read() | |
| 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 | |
| int | _timeout = 10 |
| WM8960Config | cfg |
| I2SStream | i2s |
| AudioInfo | info |
| bool | is_notify_active = true |
| Vector< AudioInfoSupport * > | notify_vector |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| float | volume_in |
| float | volume_out |
| int | write_buffer_size = MAX_SINGLE_CHARS |
Stream for reading and writing audio data using the WM8960 Codec Chip You need to install https://github.com/pschatzmann/arduino-wm8960.
|
default |
|
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.
|
inlinevirtual |
Starts with the default config or restarts.
Reimplemented from BaseStream.
|
inline |
Starts with the indicated configuration.
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inlineprotected |
|
inline |
|
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.
|
inlineprotected |
if microcontroller is master then module is slave
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 >.
|
inlineprotected |
Defines the input AudioInfo.
Reimplemented from AudioStream.
|
inline |
defines the default configuration that is used with the next begin()
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
|
inline |
provides the volume
|
inline |
|
inlineprotected |
Reimplemented from AudioStream.
Reimplemented in MemoryStream, AudioStreamWrapper, BufferedTaskStream, RingBufferStream, BufferedStream, and URLStream.
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |