PCM Mixer Filter

[This is preliminary documentation and subject to change.]

The audio mixer will accept input formats of WAVE_FORMAT_PCM and WAVE_FORMAT_MULAW. The only output format is WAVE_FORMAT_PCM. This means that the mixer will do a minimal translation from muLaw to PCM.

It can mix 8-bit or 16-bit samples. When the input format is WAVE_FORMAT_PCM, the input and output sample sizes must be the same. If the input format is WAVE_FORMAT_MULAW the output sample size can be 8 or 16 bits.

The mixer can mix with any buffer size or sampling frequency. The only restriction is that the buffer size and frequency must be the same for all inputs and output. The only exception is when the input format is muLaw and the output sample size is 16 bits. Then the output buffer size must be exactly twice the input buffer size.

The mixer operates on a timed basis and thus does not wait for input to all its sources in order to mix. Using a delay that is determined by the buffer size, bits per sample, and sampling frequency, the mixer will periodically check all its inputs for data, then mix and deliver whatever data is available. When no data is available on any input, the mixer will deliver artificial silence.