battlefield_learner
battlefield_learner

Reputation: 43

java - best way to compare mp3 and wav files with different specifications?

Speaking conceptually, is there a way to compare .mp3 and .wav files? If so what? Is converting .mp3 to .wav files advisable for comparison?

Anybody who can just explain me the concept would be really helpful. I have done a comparison of wav files using FFT but want to now compare mp3 and wav files.

Upvotes: 1

Views: 337

Answers (1)

Scott Stensland
Scott Stensland

Reputation: 28285

Just to get you started - here is a command to convert mp3 into wav

avconv -i  input.mp3   output.wav

where avconv is a swiss army knife of audio see https://libav.org

Once you have two wav files, and have parsed their headers so U have access to their raw PCM audio its a matter of comparing two curves. Each sample of the audio curve upon generating such a audio file happens 44100 time per second, (can vary 48k is also common). The normalized audio curve varies from -1 to +1 (yet may vary from 0 to 2^16 - 1). Typically each sample is stored as 16 bits of information which consumes two 8 bit bytes of storage.

Upvotes: 1

Related Questions