哈希原始音频数据
我正在寻找此任务的解决方案:我想打开任何音频文件(MP3、FLAC、WAV),然后将其处理为提取的形式并散列此数据。问题是:我不知道如何获取提取的音频数据。 DirectX 可以完成这项工作,对吧?另外,我想如果我有两个 MP3 文件,两者都是 320kbps,只有 ID3 标签不同,并且文件内部有垃圾与音频数据混合(MP3 格式允许垃圾在里面),我提取这两个文件,我应该得到完全相同的音频数据,对吧?例如,如果一个文件是 128,另一个文件是 320,我只会有所不同。好吧,问题是,有没有办法使用 DirectX 来获取这些提取的音频数据?我想这将是一些返回字节数组或其他东西的函数。另外,只提取整个文件而不播放会很方便。我想处理数百个文件,因此每个文件 3-10 分钟/秒(如果必须以自然速度播放文件进行解码)比每个文件一秒(仅提取)要糟糕得多 我希望我的问题是可以理解的。
非常感谢您的回答,
亚伦
I'm looking for a solution to this task: I want to open any audio file (MP3,FLAC,WAV), then proceed it to the extracted form and hash this data. The thing is: I don't know how to get this extracted audio data. DirectX could do the job, right? And also, I suppose if I have fo example two MP3 files, both 320kbps and only ID3 tags differ and there's a garbage inside on of the files mixed with audio data (MP3 format allows garbage to be inside) and I extract both files, I should get the exactly same audio data, right? I'd only differ if one file is 128 and the other 320, for example. Okay so, the question is, is there a way to use DirectX to get this extracted audio data? I imagine it'd be some function returning byte array or something. Also, it would be handy to just extract whole file without playback. I want to process hundreds of files so 3-10min/s each (if files have to be played at natural speed for decoding) is way worse that one second for each file (only extracting)
I hope my question is understandable.
Thanks a lot for answers,
Aaron
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 http://sox.sourceforge.net/ (多平台)。它比实时速度更快,如您所愿,而且它比 DirectX 更适合批处理模式。例如,
sox -r 48k -b 16 -L -c 1 in.mp3 out.raw
。使用您喜欢的任何脚本语言(bash、python、.bat...)在数百个文件上循环。Use http://sox.sourceforge.net/ (multiplatform). It's faster than realtime as you'd like, and it's designed for batch mode much more than DirectX. For example,
sox -r 48k -b 16 -L -c 1 in.mp3 out.raw
. Loop that over your hundreds of files using whatever scripting language you like (bash, python, .bat, ...).