|
arduino-audio-tools
|
Class which measures the thruput. More...
#include <AudioStreams.h>
Public Member Functions | |
| MeasuringStream (int count=10, Print *logOut=nullptr) | |
| MeasuringStream (Print &print, int count=10, Print *logOut=nullptr) | |
| MeasuringStream (Stream &stream, int count=10, Print *logOut=nullptr) | |
| 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 () |
| int | available () override |
| virtual int | availableForWrite () override |
| Provides the nubmer of bytes we can write. | |
| bool | begin () override |
| bool | begin (AudioInfo info) |
| int | bytesPerSecond () |
| Returns the actual thrughput in bytes per second. | |
| uint32_t | bytesSinceBegin () |
| Provides the total processed bytes since the last call of begin() | |
| virtual void | clearNotifyAudioChange () |
| Deletes all change notify subscriptions. | |
| virtual void | end () |
| uint32_t | estimatedOpenTimeFor (uint32_t totalBytes) |
| Provides the estimated time from now to the end in ms. | |
| uint32_t | estimatedTotalTimeFor (uint32_t totalBytes) |
| Provides the estimated runtime in milliseconds for the indicated total. | |
| virtual void | flush () override |
| int | framesPerSecond () |
| Returns the actual thrughput in frames (samples) per second. | |
| bool | isNotifyActive () |
| Checks if the automatic AudioInfo update is active. | |
| virtual | operator bool () |
| size_t | readBytes (uint8_t *data, size_t len) override |
| Provides the data from all streams mixed together. | |
| 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) override |
| Defines the input AudioInfo. | |
| void | setFrameSize (int size) |
| Trigger reporting in frames (=samples) per second. | |
| void | setLogOutput (Print &out) |
| Defines the logging output. | |
| void | setName (const char *name) |
| void | setNotifyActive (bool flag) |
| Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
| void | setOutput (Print &out) override |
| Defines/Changes the output target. | |
| bool | setProcessedBytes (uint32_t pos) |
| void | setReportBytes (bool flag) |
| Report in bytes instead of samples. | |
| void | setStream (Stream &io) override |
| Defines/Changes the input & output. | |
| void | setWriteBufferSize (int size) |
| uint32_t | startTime () |
| Provides the time when the last measurement was started. | |
| uint32_t | timeSinceBegin () |
| Provides the time in ms since the last call of begin() | |
| virtual size_t | write (const uint8_t *data, size_t len) override |
| Writes raw PCM audio data, which will be the input for the volume control. | |
| virtual size_t | write (uint8_t ch) override |
| virtual void | writeSilence (size_t len) |
| Writes len bytes of silence (=0). | |
Protected Member Functions | |
| size_t | measure (size_t len) |
| virtual int | not_supported (int out, const char *msg="") |
| void | notifyAudioChange (AudioInfo info) |
| void | printResult () |
| void | refillReadBuffer () |
| Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read() | |
Protected Attributes | |
| int | _timeout = 10 |
| int | bytes_per_second = 0 |
| int | count = 0 |
| int | frame_size = 0 |
| AudioInfo | info |
| bool | is_notify_active = true |
| int | max_count = 0 |
| uint32_t | ms_at_begin = 0 |
| const char * | name = "" |
| Vector< AudioInfoSupport * > | notify_vector |
| NullStream | null |
| Print * | p_logout = nullptr |
| Print * | p_print = nullptr |
| Stream * | p_stream = nullptr |
| bool | report_bytes = false |
| uint32_t | start_time |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| int | total_bytes = 0 |
| uint32_t | total_bytes_since_begin = 0 |
| int | write_buffer_size = MAX_SINGLE_CHARS |
Class which measures the thruput.
|
inline |
|
inline |
|
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.
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 >.
|
inlineoverridevirtual |
Reimplemented from BaseStream.
Provides the nubmer of bytes we can write.
Reimplemented from BaseStream.
|
inlineoverridevirtual |
Reimplemented from BaseStream.
|
inline |
Returns the actual thrughput in bytes per second.
|
inline |
Provides the total processed bytes since the last call of begin()
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
Reimplemented in FaustStream< DSP >, AudioMP34DT05, I2SCodecStream, MozziStream, PureDataStream, SPDIFOutput, VS1053Stream, WM8960Stream, AdaptiveResamplingStream, AudioLoRa, ESPNowStream, BufferedTaskStream, URLStreamBufferedT< T >, URLStreamBufferedT< ICYStream >, Equalizer3Bands, I2SStream, AudioStreamWrapper, TimerCallbackAudioStream, FormatConverterStream, GoertzelStream, FileLoopT< FileType >, FileLoopT< File >, EqualizerNBands< SampleT, AccT, NUM_TAPS, NUM_BANDS >, LoRaStream, EncodedAudioStream, AudioFFTBase, AudioKitStream, MiniAudioStream, PortAudioStream, StdioStream, A2DPStream, HLSStreamT< URLStream >, HttpRequest, ICYStreamT< T >, URLStream, URLStreamESP32, SPIAudioSlave, AnalogAudioArduino, AnalogAudioStream, AudioEffectStreamT< T >, Equalizer3BandsPerChannel, ReformatBaseStream, AdapterAudioOutputToAudioStream, MemoryStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, InputMixer< T, SumT >, InputMerge< T >, CallbackStream, FilteredStream< T, TF >, FilteredStream< int16_t, int16_t >, ChannelFormatConverterStream, NumberFormatConverterStream, CatStream, QueueStream< T >, QueueStream< uint8_t >, DynamicMemoryStream, Pipeline, Pipeline::ModifyingStreamAdapter, VolumeStream, AudioBLEClient, AudioBLEClient, AudioBLEServer, AudioBLEServer, AbstractURLStream, and AudioBLEStream.
Provides the estimated time from now to the end in ms.
Provides the estimated runtime in milliseconds for the indicated total.
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 |
Returns the actual thrughput in frames (samples) per second.
|
inlineprotected |
Provides the data from all streams mixed together.
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)
Defines/Changes the output target.
Implements ModifyingStream.
Alternative update method: e.g report actual file positon: returns true if the file position was increased
Defines/Changes the input & output.
Implements ModifyingStream.
|
inline |
Provides the time when the last measurement was started.
Writes raw PCM audio data, which will be the input for the volume control.
Reimplemented from AudioStream.
Reimplemented in MemoryStream, AudioStreamWrapper, BufferedTaskStream, RingBufferStream, BufferedStream, and URLStream.
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |