| Miles Sound System SDK 7.2a |
The function AIL_process_digital_audio provides high-level access to the Miles sound mixer.
S32 AIL_process_digital_audio( void *dest, S32 destsize, U32 destrate, U32 destformat, S32 num_srcs, AILMIXINFO const * const *srcs ); |
The number of bytes mixed if the call was successful, or 0 if the call failed.
You can use this function to mix one or more samples together, perform sample rate conversions - basically anything that the Miles mixer can do!
This function modifies the srcs data structures, so that you can call it over and over mixing the next pieces of the input data each call (this is handy when mixing through a small destination buffer.
This function can directly accept IMA ADPCM compressed data, but not MPEG Layer 3 or other ASI-compressed data.
Multichannel (> 2 channels) data is not supported.
You can use the AIL_WAV_info function to automatically fill the input src->Info structures. However, the output data is raw data, so you should use AIL_WAV_file_write if you need to write the output data in wave format.
Example: The following example will mix two wave files together and write out the result:
void* in1, * in2, * out;
AILMIXINFO mix[2];
U32 outsize, mixsize;
In1=AIL_file_read("file1.wav",0);
In2=AIL_file_read("file2.wav",0);
AIL_WAV_info(in1,&mix[0].Info);
AIL_WAV_info(in2,&mix[1].Info);
outsize=AIL_size_processed_digital_audio(44100,DIG_F_MONO_16,2,mix);
out=AIL_mem_alloc_lock(outsize);
mixsize=AIL_process_digital_audio(out,outsize,44100,DIG_F_MONO_16,2,mix);
AIL_WAV_file_write("mixed.wav",out,mixsize,44100,DIG_F_MONO_16);
Group:
Utility Services
Related Functions:
AIL_WAV_file_write, AIL_WAV_info, AIL_scratchpad_policy, AIL_set_scratchpad_policy, AIL_size_processed_digital_audio
Related Basic Types:
MILES_DIGITAL_FORMAT, MSS_RESOURCE_POLICY, S32, U32, void
Related Structures:
AILMIXINFO, AILSOUNDINFO
Related FAQs:
How can I assign 3D positions to stereo samples?
For technical support, e-mail Miles3@radgametools.com
© Copyright 1991-2007 RAD Game Tools, Inc. All Rights Reserved.