tedd wrote: > Hi gang: > > I can combine two mp3 sound files together by simply: > > // load first > > $file = "a.mp3"; > $handle = fopen($file, "rb"); > $size = filesize($file); > $load = fread($handle, $size); > fclose($handle); > > // load second > > $file = "b.mp3"; > $handle = fopen($file, "rb"); > $size = filesize($file); > $load .= fread($handle, $size); > fclose($handle); > > // save both as one audio file > > $filename = "tmp/a.mp3"; > $file = fopen( $filename, "wb" ); > fwrite( $file, $load); > fclose( $file ); > > However, I can't do the same with .WAV files. Does anyone know a way to > combine .WAV files similar to the way shown above? If you are using linux I'd just shell out to sox or similar. BTW the MP3s you produce in the above way are perhaps not that "prefect". MP3 is a frame based format which means that you can in theory combine two files quite simply, but I'm not sure how well it will all work with if the two files are different bit rates or one is a VBR etc. WAV format is quite similar to raw PCM, but it does have a header. It's a relatively simple format tho' so the specs are relatively easy to understand (tho' I've not looked at them for a while. In theory, it should just be a matter of removing the WAV header from the second file and concatenating as per your above algorithm, but in practice it is more complex. WAV allows different sample rates and channels etc. so you may have to resample the files to allow for simple concatenation. All in all, I think sox will solve your problems if you can shell out in linux. sox is for sound what imagemagick is for graphics. HTH Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php