Is there a best practice for concatenating MP3 Files, adjusting sample rates to match, while preserving original files?

Posted by Scott on Stack Overflow See other posts from Stack Overflow or by Scott
Published on 2011-01-10T14:09:03Z Indexed on 2011/01/10 15:53 UTC
Read the original article Hit count: 241

Filed under:
|
|
|
|

Hello overflow community!

Does anyone know if there is a "best practice" to concatenate mp3 files to create new files, while preserving the original files?

I am working on a CentOS Linux machine, in command line. I will eventually call the command line from a PHP script.

I have been doing research and I have come up with a process that I think could work. It combines general advice from different forums, blogs, and sources like this one.

So here I go:

  1. Create a temporary folder
  2. Loop through files to create a new, converted copy, of file into a "raw" format (which one, I don't know. I didn't know "raw" files existed before too long ago. I could use some suggestions on this)
  3. Store the path to the temporary files, in the temporary folder, and then loop through the files to concatenate them and then put the new merged file the final "processed directory"
  4. Delete the contents of the temporary file with the temporary raw files inside.
  5. Convert the final file from "raw" to mp3 and enjoy the finished result

I'm thinking that this course of action might be best because I can't necessarily control the quality of the original "source" mp3s.

The only other option I could think of would be to create a script that would perform a similar process upon files being added to the system leaving only the files with the "proper" format and removing the original "erroneous" file.

Hopefully you can see that I have put some thought into this and that I'm trying to leverage the collective knowledge of this community to choose the best direction.

Perhaps there is a better path that I could take?

By concatenate, I mean to join together in sequence to create a new audio file from the "concatenated files."

© Stack Overflow or respective owner

Related posts about php

Related posts about linux