简体   繁体   English

散列原始音频数据

[英]Hashing raw audio data

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. 我正在寻找此任务的解决方案:我想打开任何音频文件(MP3,FLAC,WAV),然后将其处理为提取的表单并对该数据进行哈希处理。 The thing is: I don't know how to get this extracted audio data. 关键是:我不知道如何获取提取的音频数据。 DirectX could do the job, right? DirectX可以完成这项工作,对吧? 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? 而且,我想,如果我有两个MP3文件的示例,这两个文件均为320kbps,只有ID3标签不同,并且里面混有音频数据的文件中有一个垃圾(MP3格式允许将垃圾放入其中),并且我提取了这两个文件应该获得完全相同的音频数据,对不对? I'd only differ if one file is 128 and the other 320, for example. 例如,如果一个文件是128,而另一个文件是320,我只会有所不同。 Okay so, the question is, is there a way to use DirectX to get this extracted audio data? 好的,问题是,是否可以使用DirectX来获取提取的音频数据? 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. 我想处理数百个文件,所以每个3-10分钟/秒(如果必须以自然速度播放文件以进行解码)会比每个文件一秒钟(仅提取)更糟,我希望我的问题是可以理解的。

Thanks a lot for answers, 非常感谢您的回答,

Aaron 亚伦

Use http://sox.sourceforge.net/ (multiplatform). 使用http://sox.sourceforge.net/ (多平台)。 It's faster than realtime as you'd like, and it's designed for batch mode much more than DirectX. 它比您想要的要快,并且比DirectX更适合批处理模式。 For example, sox -r 48k -b 16 -L -c 1 in.mp3 out.raw . 例如, 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, ...). 使用您喜欢的任何脚本语言(bash,python,.bat等)将其循环到数百个文件中。

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

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