I use the following code to append as many wav files present in the sdcard to a single file. audFullPath is an arraylist containing the path of the audiofiles. Is it correct
You can't append WAV files the way you do. That's because each WAV has special format:
The simplest possible WAV file looks like this:
[RIFF HEADER]
...
totalFileSize
[FMT CHUNK]
...
audioFormat
frequency
bytesPerSample
numberOfChannels
...
[DATA CHUNK]
dataSize
What you need to do is:
WAV files are of compatible: same audioFormat, frequency, bits per sample, number of channels, etc. RIFF header with total file size FMT header DATA header with total audio data size This algorithm will definitely work for LPCM, ULAW, ALAW audio formats. Not sure about others.