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 (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 () |
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream | |
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. | |
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 () |
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 |
Stream that provides audio information that was generated using the Mozzi API using the updateControl() and updateAudio() methods.
|
inlinevirtualinherited |
Adds target to be notified about audio changes.
Reimplemented in CodecNOP, MP3DecoderMAD, EncodedAudioOutput, EncodedAudioStream, AACDecoderFDK, DecoderBasic, MP3DecoderHelix, OggContainerDecoder, 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, and ResampleStream.
Reimplemented from Stream.
Reimplemented in AudioKitStream, A2DPStream, I2SCodecStream, TfLiteAudioStream, UDPStream, ICYStream, BufferedTaskStream, I2SStream, TimedStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, BufferedStream, ConverterStream< T >, InputMerge< T >, Pipeline::ModifyingStreamAdapter, and VolumeStream.
Reimplemented from Print.
Reimplemented in UDPStream, A2DPStream, I2SCodecStream, AbstractURLStream, I2SStream, MeasuringStream, ProgressStream, and VolumeStream.
|
inlinevirtual |
Reimplemented from BaseStream.
|
inlinevirtual |
Reimplemented from BaseStream.
Reimplemented from Print.
Reimplemented in ResampleStream, ICYStreamBuffered, BufferedTaskStream, 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
Reimplemented in A2DPStream, Pipeline, I2SStream, and MemoryStream.
Provides the data filled by calling updateAudio()
Reimplemented from AudioStream.
Defines the input AudioInfo.
Reimplemented from AudioStream.
define the actual volume in the range of 0.0f to 1.0f
Reimplemented in Maximilian, I2SCodecStream, VS1053Stream, VolumeStream, A2DPStream, and AudioPlayer.
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 BufferedTaskStream, and BufferedStream.