Advertisement Jump to content
Sign in to follow this  

Comparing two mp3's

This topic is 4895 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Imagine that I've got a mp3 of a full sample (song) call this O. Using any audio tool, I cut out a piece of O, say twenty seconds somewhere in the middle. I save this sample as a mp3, probably with a different bit-rate, volume (compression) and fade in/out. Call this sample S. Now to the problem: I need a way of telling if S is a part of O, or more realistic: how closely does S match any part of O? Are there any tools/libraries that can perform the above? If not, how do I get around doing it? I've not done any programming with mp3's so I'll guess I need some library to read 'em in. Then what? * Decompress S and O into 44KHz, 16-bit samples * Perform a FFT of the whole S, normalize it, call it s. * For every possible start sample in O: * Perform a FFT of the same number of samples as in S, normalize it, call it o. * Calculate a value of how closely s matches o. Save the best fit value * Continue with next sample position. * Return the value of the closest fit (additionally with position). I'm lucky since I only need to test one mp3 against one other mp3. It would be a different problem if I wanted to find the closest matching mp3 in a set of thousands of mp3's. Any suggestions? [Edited by - eq on August 25, 2005 5:06:29 PM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!