|
arduino-audio-tools
|
Dynamic Resampling. We can use a variable factor to speed up or slow down the playback. More...
#include <ResampleStream.h>
Protected Member Functions | |
| template<typename T > | |
| T | getValue (T *data, float frame_idx, int channel) |
| get the interpolated value for indicated (float) index value | |
| template<typename T > | |
| T | lookup (T *data, int frame, int channel) |
| lookup value for indicated frame & channel: index starts with -1; | |
| 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() | |
| void | setupLastSamples (AudioInfo cfg) |
| Sets up the buffer for the rollover samples. | |
| template<typename T > | |
| void | setupLastSamples (T *data, int frame) |
| store last samples to provide values for index -1 | |
| void | setupReader () |
| template<typename T > | |
| size_t | write (Print *p_out, const uint8_t *buffer, size_t bytes, size_t &written) |
| Writes the buffer to defined output after resampling. | |
Protected Attributes | |
| int | _timeout = 10 |
| int | bytes_per_frame = 0 |
| float | idx = 0 |
| AudioInfo | info |
| bool | is_buffer_active = USE_RESAMPLE_BUFFER |
| bool | is_first = true |
| bool | is_notify_active = true |
| Vector< uint8_t > | last_samples {0} |
| Vector< AudioInfoSupport * > | notify_vector |
| SingleBuffer< uint8_t > | out_buffer {0} |
| Print * | p_out = nullptr |
| Print * | p_print = nullptr |
| Stream * | p_stream = nullptr |
| TransformationReader< ReformatBaseStream > | reader |
| float | step_size = 1.0 |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| int | to_sample_rate = 0 |
| int | write_buffer_size = MAX_SINGLE_CHARS |
Dynamic Resampling. We can use a variable factor to speed up or slow down the playback.
| T |
|
default |
|
inline |
Support for resampling via write.
|
inline |
Support for resampling via write. The audio information is copied from the io
|
inline |
Support for resampling via write and read.
|
inline |
Support for resampling via write and read. The audio information is copied from the io
|
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 >.
|
inlineoverridevirtual |
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
Reimplemented from AudioInfoSupport.
|
inlineoverridevirtualinherited |
Reimplemented from BaseStream.
|
inlineoverridevirtualinherited |
Reimplemented from BaseStream.
|
inlineoverridevirtual |
Reimplemented from BaseStream.
|
inline |
|
inline |
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inline |
Provides the default configuraiton.
|
inlineoverridevirtualinherited |
Reimplemented from BaseStream.
|
inlinevirtual |
When buffering is active, writes the buffered audio to the output.
Reimplemented from BaseStream.
|
inlineoverridevirtual |
Implements ReformatBaseStream.
|
inline |
Returns the actual step size.
calculate the step size the sample rate: e.g. from 44200 to 22100 gives a step size of 2 in order to provide fewer samples
get the interpolated value for indicated (float) index value
lookup value for indicated frame & channel: index starts with -1;
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 >.
Define the size of the interal read result queue: same as transformationReader().resizeResultQueue(size)
Defines the input AudioInfo.
Reimplemented from AudioStream.
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
|
inlinevirtualinherited |
Reimplemented in FormatConverterStream, and EncodedAudioStream.
Defines/Changes the output target.
Implements ModifyingStream.
Reimplemented in EncodedAudioStream, and FormatConverterStream.
|
inlinevirtualinherited |
Reimplemented in FormatConverterStream, and EncodedAudioStream.
Defines/Changes the input & output.
Implements ModifyingStream.
Reimplemented in FormatConverterStream, and EncodedAudioStream.
store last samples to provide values for index -1
|
inlineprotectedinherited |
|
inlinevirtualinherited |
Provides access to the TransformationReader.
Reimplemented from AudioStream.
|
inlineprotected |
Writes the buffer to defined output after resampling.
Reimplemented in MemoryStream, AudioStreamWrapper, BufferedTaskStream, RingBufferStream, BufferedStream, and URLStream.
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |