BackgroundAudio 1.3.3
|
Real-time, IRQ driven mixer with configurable number of inputs. More...
#include <BackgroundAudioMixer.h>
Public Member Functions | |
BackgroundAudioMixer (AudioOutputBase &d, int outputRate) | |
Construct a mixer with output device and constant sample rate. | |
BackgroundAudioMixerInput * | add () |
Create a new input leg on the mixer, usable as an AudioOutputBase . Only legal before begin | |
bool | begin () |
Start the mixer and attached physical interface. | |
Real-time, IRQ driven mixer with configurable number of inputs.
Mixing is handled by creating multiple emulated input legs of BackgroundAudioMixerInput
.
Each input leg behaves as its own independent AudioOutputBase
as far as an output generator is concerned (i.e. a returned BackgroundAudioMixerInput
can be passed in to the MP3 or WAV decoder with no special handling needed.
All BackgroundAudioMixerInput
objects transparently resample their reports back to the parent BackgroundAudioMixer
so all the mixer here has to do is sum up all its legs and send the result out to the real hardware (I2S or PWM).
_outWords | Number of 32-bit (one stereo 16-bit sample) words to use for the summing buffer |
|
inline |
Construct a mixer with output device and constant sample rate.
[in] | d | AudioOutputBase to actually output sound to |
[in] | outputRate | Fixed output sample rate. All input legs will be resampled to this rate. |
|
inline |
Create a new input leg on the mixer, usable as an AudioOutputBase
. Only legal before begin
BackgroundAudioMixerInput
(of class AudioOutputBase
) to be used by an audio generator, or nullptr
in case of error
|
inline |
Start the mixer and attached physical interface.
Starts all the emulated input legs of the mixer as well as the physical interface summed data will be sent to. The physical output sample rate is fixed at this time and all audio data is resampled to this speed transparently.