PHP Classes

Merge WAV files or convert MP3 to WAV using PHP: I can't merge a number of wav files into 1 file with PHP

Recommend this page to a friend!
  All requests RSS feed  >  Merge WAV files or convert MP3 to WAV...  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

Merge WAV files or convert MP3 to WAV using PHP


Picture of Sameeroaf Bazivitch by Sameeroaf Bazivitch - 8 years ago (2014-11-02)

I can't merge a number of wav files into 1 file with PHP

This request is clear and relevant.
This request is not clear or is not relevant.


I was able to use file_get_contents and file_put_contents to merge a number of MP3 audio files into a single MP3 file successfully.

I tried to do the same with WAV audio files, which I really need, but PHP takes the first WAV file and skips all the rest so the result is a WAV file with the first input wav file from the list.

If that is difficult or not possible to merge WAV files, then I need to convert the MP3 file into WAV with the ability to change the sample rate if possible.

Ask clarification

1 Recommendation

.wav Creator: Create .wav file from multiple audio files

This recommendation solves the problem.
This recommendation does not solve the problem.


Picture of Manuel Lemos by Manuel Lemos Reputation 22655 - 8 years ago (2014-11-02) Comment

You can't merge multiple WAV files like you can with concatenating multiple MP3 because the WAV format header needs to be rebuilt to consider that your WAV audio data is made of multiple parts.

MP3 is based on MPEG, so it is frame based and you can start playing frames from the middle of the stream.

Anyway, the WAV creator class can compose the result WAV file made of multiple WAV files as you wish, so you do not need to convert to MP3.

Recommend package