arduino-audio-tools
|
TfLiteAudioStream which uses Tensorflow Light to analyze the data. If it is used as a generator (where we read audio data) More...
#include <TfLiteAudioStream.h>
Public Member Functions | |
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 () |
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream | |
virtual int | available () override |
We can provide only some audio data when cfg.input is defined. | |
virtual int | availableForWrite () override |
virtual int | availableToWrite () override |
Constant streaming. | |
virtual bool | begin () |
virtual bool | begin (TfLiteConfig config) override |
Start the processing. | |
virtual void | clearNotifyAudioChange () |
Deletes all change notify subscriptions. | |
TfLiteConfig & | config () override |
Provides the TfLiteConfig information. | |
virtual TfLiteConfig | defaultConfig () override |
virtual void | end () |
virtual void | flush () override |
tflite::MicroInterpreter & | interpreter () override |
Provides the tf lite interpreter. | |
bool | isNotifyActive () |
Checks if the automatic AudioInfo update is active. | |
int8_t * | modelInputBuffer () override |
Provides access to the model input buffer. | |
virtual | operator bool () |
virtual size_t | readBytes (uint8_t *data, size_t len) override |
provide audio data with cfg.input | |
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. | |
virtual void | setAudioInfo (AudioInfo newInfo) override |
Defines the input AudioInfo. | |
void | setInterpreter (tflite::MicroInterpreter *p_interpreter) |
Optionally define your own p_interpreter. | |
void | setNotifyActive (bool flag) |
Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
virtual size_t | write (const uint8_t *data, size_t len) override |
process the data in batches of max kMaxAudioSampleSize. | |
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 | notifyAudioChange (AudioInfo info) |
void | refillReadBuffer () |
virtual bool | setModel (const unsigned char *model) |
virtual bool | setupInterpreter () |
virtual bool | setupWriter () |
Protected Attributes | |
int | _timeout = 10 |
TfLiteConfig | cfg |
AudioInfo | info |
bool | is_notify_active = true |
bool | is_setup = false |
Vector< AudioInfoSupport * > | notify_vector |
tflite::MicroInterpreter * | p_interpreter = nullptr |
const tflite::Model * | p_model = nullptr |
TfLiteTensor * | p_tensor = nullptr |
uint8_t * | p_tensor_arena = nullptr |
int8_t * | p_tensor_buffer = nullptr |
RingBuffer< uint8_t > | tmp_in {0} |
RingBuffer< uint8_t > | tmp_out {0} |
TfLiteAudioStream which uses Tensorflow Light to analyze the data. If it is used as a generator (where we read audio data)
|
inlinevirtualinherited |
Adds target to be notified about audio changes.
Reimplemented in CodecNOP, MP3DecoderMAD, EncodedAudioOutput, EncodedAudioStream, AACDecoderFDK, DecoderBasic, MP3DecoderHelix, OggContainerDecoder, Pipeline, and Pipeline::ModifyingStreamAdapter.
provides the actual input AudioInfo
Implements AudioInfoSupport.
Reimplemented in JupyterAudioT< T >, MozziStream, TimerCallbackAudioStream, PureDataStream, AdapterAudioOutputToAudioStream, GeneratedSoundStream< T >, and GeneratedSoundStream< int16_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, and ResampleStream.
We can provide only some audio data when cfg.input is defined.
Reimplemented from BaseStream.
Reimplemented from Print.
Reimplemented in UDPStream, A2DPStream, AudioFFTBase, I2SCodecStream, AbstractURLStream, URLStreamESP32, I2SStream, MeasuringStream, ProgressStream, and VolumeStream.
Constant streaming.
Implements TfLiteAudioStreamBase.
Reimplemented in AudioOutputWithCallback, HLSStream, SPDIFOutput, VS1053Stream, WM8960Stream, ESPNowStream, TimerCallbackAudioStream, QueueStream< T >, QueueStream< uint8_t >, DynamicMemoryStream, AudioFFTBase, AnalogAudioArduino, AnalogAudioStream, MemoryStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, FormatConverterStream, and Pipeline.
|
inlineoverridevirtual |
Start the processing.
Implements TfLiteAudioStreamBase.
|
inlineoverridevirtual |
Provides the TfLiteConfig information.
Implements TfLiteAudioStreamBase.
|
inlineoverridevirtual |
Implements TfLiteAudioStreamBase.
Reimplemented in FaustStream< DSP >, HLSStream, I2SCodecStream, VS1053Stream, WM8960Stream, ESPNowStream, I2SStream, TimerCallbackAudioStream, QueueStream< T >, QueueStream< uint8_t >, AudioFFTBase, AudioKitStream, AnalogAudioStream, HttpRequest, ICYStreamT< T >, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, InputMixer< T >, InputMerge< T >, and Pipeline.
Reimplemented from Print.
Reimplemented in ResampleStream, BufferedTaskStream, and BufferedStream.
|
inlineoverridevirtual |
Provides the tf lite interpreter.
Implements TfLiteAudioStreamBase.
|
inlineoverridevirtual |
Provides access to the model input buffer.
Implements TfLiteAudioStreamBase.
Reimplemented in A2DPStream, Pipeline, I2SStream, and MemoryStream.
provide audio data with cfg.input
Reimplemented from AudioStream.
Defines the input AudioInfo.
Implements AudioInfoSupport.
Reimplemented in VS1053Stream, WM8960Stream, I2SBitBang, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, VolumeStream, MiniAudioStream, PortAudioStream, I2SCodecStream, MozziStream, SPDIFOutput, AudioLoRa, AnalogAudioStream, I2SStream, MeasuringStream, VolumeMeter, TimerCallbackAudioStream, AudioBLEStream, LoRaStream, AudioFFTBase, AudioKitStream, VBANStream, AnalogAudioArduino, Equalizer3Bands, AdapterAudioOutputToAudioStream, TimedStream, ProgressStream, FormatConverterStream, FadeStream, Pipeline::ModifyingStreamAdapter, PureDataStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, Pipeline, and ResampleStream.
|
inlinevirtual |
Optionally define your own p_interpreter.
Implements TfLiteAudioStreamBase.
process the data in batches of max kMaxAudioSampleSize.
Implements TfLiteAudioStreamBase.
Reimplemented in BufferedTaskStream, and BufferedStream.