I have hundreds of pairs of instrumental/vocal MP3 files. The instrumental version has music played with instruments. The vocal version does too, but it also has a vocal track overlaid.

I don't know what all processing went into creating these MP3 files, but I do know that the instrumental and vocal versions often do not have the same length, and they often start with a different length of silence.

I need to figure out what the offset is between each pair of MP3 files. Because there are so many of them, I would prefer a command line or batch solution.

I don't know anything about signal processing, I'm hoping for some existing tool that can easily do this. Any ideas?

  • 1. What operating system (OS) are you using? 2. How are the files arranged and named--i.e. all in one folder, with same starting names? 3. How do you now know which instrumental file goes to the corresponding vocal file?
    – Rolo
    Jan 3, 2015 at 12:53
  • 1. Mac OS X. 2. Currently as two folders with identical names in each, but I can trivially change that to whatever is needed. 3. They have the same name. Jan 3, 2015 at 16:19
  • So, in one folder, you have for example song-abc.mp3 and in another folder song-abc.mp3 and therefore you already know which are the instrumental and which are the vocals and instrumentals, because all vocals are in one folder and all instrumentals are in another? Is that correct?
    – Rolo
    Jan 3, 2015 at 17:03
  • Yes, just like that. Jan 3, 2015 at 17:29
  • Well, one way would be to be able to export the properties of the file to a csv / Excel file and then you can have a column calculating the difference. So, the columns could be something like folderpath1, song, time/duration, folderpath2, song, time/duration, difference in time. I however don't know how to get this information. I was looking around yesterday at file managers, but though one of them exports information like name and dates, it doesn't export other fields like duration. I would suggest looking at such programs and see if they can help you. See next comment for more info.
    – Rolo
    Jan 3, 2015 at 17:50

1 Answer 1


This other post recommends SOX which looks like it deserves looking into.

  • Brilliant. I was making this way too complicated. Jan 24, 2015 at 17:47
  • I combined the post you pointed me to with a post on parsing sox output. I can now get the length of the starting silence of any given MP3, which I can use to calculate offsets between paired MP3s. Thank you! Jan 24, 2015 at 17:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.