|
arduino-audio-tools
|
Stream that provides audio information that was generated using the Mozzi API using the updateControl() and updateAudio() methods. More...
#include <MozziStream.h>
Public Member Functions | |
| MozziStream ()=default | |
| MozziStream (Stream &in) | |
| virtual void | addNotifyAudioChange (AudioInfoSupport &bi) |
| Adds target to be notified about audio changes. | |
| AudioInfo | audioInfo () |
| provides the actual input AudioInfo | |
| virtual AudioInfo | audioInfoOut () |
| int | audioRate () |
| virtual int | available () override |
| virtual int | availableForWrite () override |
| bool | begin () |
| bool | begin (MozziConfig cfg) |
| virtual void | clearNotifyAudioChange () |
| Deletes all change notify subscriptions. | |
| MozziConfig | defaultConfig () |
| void | end () |
| virtual void | flush () override |
| int | getAudioInput () |
| bool | isNotifyActive () |
| Checks if the automatic AudioInfo update is active. | |
| virtual | operator bool () |
| size_t | readBytes (uint8_t *data, size_t len) |
| Provides the data filled by calling updateAudio() | |
| 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 info) |
| Defines the input AudioInfo. | |
| void | setInput (Stream &in) |
| void | setNotifyActive (bool flag) |
| Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
| virtual bool | setVolume (float volume) |
| define the actual volume in the range of 0.0f to 1.0f | |
| bool | setVolume (int16_t vol) |
| Defines the multiplication factor to scale the Mozzi value range to int16_t. | |
| void | setWriteBufferSize (int size) |
| virtual float | volume () |
| provides the actual volume in the range of 0.0f to 1.0f | |
| size_t | write (const uint8_t *data, size_t len) |
| Write data to buffer so that we can access them by calling getAudioInput() | |
| virtual size_t | write (uint8_t ch) override |
| virtual void | writeSilence (size_t len) |
| Writes len bytes of silence (=0). | |
Protected Member Functions | |
| int16_t | avg (int16_t *values) |
| int16_t | nextSample () |
| 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 |
| bool | active = false |
| RingBuffer< uint8_t > | buffer {0} |
| MozziConfig | cfg |
| int | control_counter |
| int | control_counter_max |
| AudioInfo | info |
| int | input_max = -32768 |
| int | input_min = 32767 |
| bool | is_notify_active = true |
| Vector< AudioInfoSupport * > | notify_vector |
| Stream * | p_input = nullptr |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| float | volume_value = 1.0f |
| int | write_buffer_size = MAX_SINGLE_CHARS |
Stream that provides audio information that was generated using the Mozzi API using the updateControl() and updateAudio() methods.
|
default |
|
inline |
|
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.
|
inlinevirtual |
provides the actual input AudioInfo
Reimplemented from AudioStream.
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 >.
|
inline |
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 >, SPIAudioSlave, 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 >, SPIAudioSlave, 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 |
Reimplemented from BaseStream.
|
inline |
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inline |
|
inlinevirtual |
Reimplemented from BaseStream.
Reimplemented from Print.
Reimplemented in PureDataStream, URLStreamBufferedT< T >, URLStreamBufferedT< ICYStream >, ReformatBaseStream, AudioStreamWrapper, ResampleStream, EncodedAudioStream, URLStream, BufferedTaskStream, I2SStream, MemoryStream, RingBufferStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, and BufferedStream.
|
inline |
Gets the next audio value either from the assigned Input Stream or the buffer that was filled by write(). The data range is defined in MozziConfig
|
inlineprotected |
Provides the data filled by calling updateAudio()
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 >.
Defines the input AudioInfo.
Reimplemented from AudioStream.
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
define the actual volume in the range of 0.0f to 1.0f
Reimplemented in Maximilian, I2SCodecStream, VS1053Stream, VolumeStream, A2DPStream, and AudioPlayer.
Defines the multiplication factor to scale the Mozzi value range to int16_t.
provides the actual volume in the range of 0.0f to 1.0f
Reimplemented in I2SCodecStream, VS1053Stream, AudioPlayer, and VolumeStream.
Write data to buffer so that we can access them by calling getAudioInput()
Reimplemented from AudioStream.
Reimplemented in MemoryStream, AudioStreamWrapper, BufferedTaskStream, RingBufferStream, BufferedStream, and URLStream.
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |