Previous Topic Index Next Topic
[API function]

FSOUND_DSP_MixBuffers

Allows the user to mix their own data from one buffer to another, using FSOUNDs optimized
mixer routines. This was mainly provided for DSP routines, though it can be used for
anything.

signed char F_API FSOUND_DSP_MixBuffers(
void *destbuffer,
void *srcbuffer,
int len,
int freq,
int vol,
int pan,
unsigned int mode
);

Parameters

destbuffer Pointer to a buffer to have the data mixed into.
srcbuffer Pointer to the source buffer to be mixed in.
len Amount to mix in SAMPLES.
freq Speed to mix data to output buffer. Remember if you mix at a rate
different than the output rate, the buffer lengths will have to be
different to compensate. Ie if the output rate is 44100 and you supply
a value of 88200 to FSOUND_DSP_MixBuffers, you will only need a destbuffer
that is half the size of srcbuffer. If you supply a value of 22050 then
you will need a destbuffer that is twice as big as srcbuffer. If they
are both the same size then it will only mix half of the data.
vol volume scalar value of mix. Valid values are 0 (silence) to 255
(full volume). See FSOUND_SetVolume for more information.
pan pan value for data being mixed. Valid values are 0 (full left), 128
(middle), 255 (full right) and FSOUND_STEREOPAN. See FSOUND_SetPan for
more information.
mode Bit settings to describe the source buffer. Valid values are found in
FSOUND_MODES, but only 8/16bit and stereo/mono flags are interpreted,
other flags are ignored.

Return Value

On success, TRUE is returned.
On failure, FALSE is returned.

Remarks

'destbuffer' should always the format of the mixing output buffer, as it will use the mixer
currently running to do the mixing.
For MMX it is 16bit stereo, so it is 4 bytes per output sample (word left, word right)
For Standard Blend mode it is 32bit stereo, so it is 8 bytes per output sample (left dword, right dword)
For FPU mixer it is 32bit float stereo, so it is 8 bytes per output sample (left float, right float)
FSOUND_GetMixer can be used to determine which mixer is being used.
___________________
Supported on the following platforms : Win32, WinCE, Linux, Macintosh, XBox, GameCube

See Also

FSOUND_DSP_Create , FSOUND_DSP_MixBuffers , FSOUND_GetMixer , FSOUND_MODES , FSOUND_SetFrequency , FSOUND_SetPan , FSOUND_SetVolume

This document copyright ©Firelight Technologies, Pty, Ltd, 1999-2002. All rights reserved.
Generated Thu Dec 15 17:31:29 2005 by SourceDoc v0.10, the automated source code documenter.