User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:188.8.131.52) Gecko/20100802 Lightning/1.0b2 Thunderbird/3.1.2
Here's code I wrote years ago for a now defunct company. It takes a
list of input filenames (.WAV files) and an output file name (.WAV
file), and combines the input files into a single output file. It isn't
iPhone, it isn't Objective C, it isn't CoreAudio. But it does combine
.WAV files by re-wrapping them into a single file. It was written in
Borland C++, but with a tiny bit of tweaking it can work with any C++
compiler. Maybe it will be of use to someone.
Accepts a TList of AnsiString full-path file names, an AnsiString
full-path file name, and a MultiBlock flag.
Processing is as follows:
Remove from the TList any file name without a .wav extension. If no
remain, then quit.
For each input file, copy the wave data into the output file
the MulitBlock flag.
If the MultiBlock flag is false, then all wave data is combined into a
single data block in the output file. The first file in the TList sets
the output format, and the remaining input files must have the same
format. The format blocks are not checked for consistency.
If the MultiBlock flag is true, then the input files may have different
formats, such as sampling rate, stereo, etc. The format block from each
file is copied to the output file, so that the .wav player can change
formats on-the-fly. This is the more powerful option, but may not be
compatible with all .wav players. In fact, I'm not aware of any that
support this, but it's here nonetheless.
strncpy( data.id, "data", 4 );
data.length = 2;
buffer = buffer = 0;
total += data.length;
if ( MultiBlock ) total += sizeof( data );
fwrite( &data, 1, sizeof( data ), oWave );
fwrite( buffer, 1, 2, oWave );
// Now that the data copy is done we need to update the length in
// the data header to reflect the total of all files copied
// EXCEPT in MultiBlock mode, which has the correct length already
// in the individual data blocks
fclose( oWave );
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden