简体   繁体   English

java-比较具有不同规格的mp3和wav文件的最佳方法?

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

Speaking conceptually, is there a way to compare .mp3 and .wav files? 从概念上讲,有没有一种方法可以比较.mp3和.wav文件? If so what? 如果可以的话 Is converting .mp3 to .wav files advisable for comparison? 是否建议将.mp3转换为.wav文件以进行比较?

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. 我已经使用FFT比较了wav文件,但现在想比较mp3和wav文件。

Just to get you started - here is a command to convert mp3 into wav 只是为了让您入门-这是将mp3转换为wav的命令

avconv -i  input.mp3   output.wav

where avconv is a swiss army knife of audio see https://libav.org avconv是瑞士音频的军刀,请参见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. 一旦有了两个wav文件,并且已经解析了它们的标头,那么U便可以访问其原始PCM音频,只需比较两个曲线即可。 Each sample of the audio curve upon generating such a audio file happens 44100 time per second, (can vary 48k is also common). 生成此类音频文件时,音频曲线的每个样本每秒发生44100次(可以变化48k也很常见)。 The normalized audio curve varies from -1 to +1 (yet may vary from 0 to 2^16 - 1). 归一化的音频曲线在-1到+1之间变化(但可能在0到2 ^ 16-1之间变化)。 Typically each sample is stored as 16 bits of information which consumes two 8 bit bytes of storage. 通常,每个样本存储为16位信息,这消耗了两个8位字节的存储空间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM