Implements an emulated AudioOutputBase and feeds resampled data from it up to an input of an AudioOutputMixer
object.
More...
|
| BackgroundAudioMixerInput (int outputRate, size_t outputBufferWords) |
| Create a mixer with a defined sample rate and buffer size.
|
|
virtual bool | setBuffers (size_t buffers, size_t bufferWords, int32_t silenceSample=0) override |
| Set the size and number of the resample buffers before begin
|
|
virtual bool | setBitsPerSample (int bps) override |
| Set the bits per sample for the emulated output. Only 16-bit supported.
|
|
virtual bool | setFrequency (int freq) override |
| Set the sample rate (LRCLK/WS) of the emulated interface. Can be called while running.
|
|
virtual bool | setStereo (bool stereo=true) override |
| Set mono or stereo mode. Only stereo supported.
|
|
virtual bool | begin () override |
| Start the emulated interface.
|
|
virtual bool | end () override |
| Stop the mixer input leg, not implemented.
|
|
virtual bool | getUnderflow () override |
| Determine if there was an underflow since the last time this was called. Cleared on read.
|
|
virtual void | onTransmit (void(*cb)(void *), void *cbData) override |
| Set the callback function to be called every mixer buffer completion.
|
|
virtual size_t | write (uint8_t) |
| Write single byte to I2S buffers. Not supported.
|
|
virtual size_t | write (const uint8_t *buffer, size_t size) override |
| Write data to the input leg interface. Will not block and may write less than requested.
|
|
virtual int | availableForWrite () override |
| Determine the number of bytes we can write to the resample buffers at this instant.
|
|
Implements an emulated AudioOutputBase and feeds resampled data from it up to an input of an AudioOutputMixer
object.
The mixer input will buffer output from one audio source and resample to the mixer frequency so it can be summed up and output.
Each input will have a buffer ready to be summed with the others. The mixer will take the pointers to this and do the sum operation w/o actually copying it out. As data is read from the mixerInputBuffer, it will be repopulated with (resampled) data from the source buffers. Every time the a full source buffer is read a CB will be fired, just like in the AudioBufferManager. (i.e. the mixedrinput will behave like the ABM for simplicity.)
In general an end user never need use this class directly and can just treat the input leg of the mixer as an ordinary audio output.