如何在wav文件中的数据读出到一个数组 [英] How to read the data in a wav file to an array
问题描述
我需要一个wav文件的所有样本获取到一个数组(或两个,如果你需要做的,以保持立体声),这样我可以申请一些修改它们。我想知道,这是很容易做到(preferably无需外部库)。我有在声音文件阅读没有经验,所以我不知道很多有关的主题。
I need to get all the samples of a wav file into an array (or two if you need to do that to keep the stereo) so that I can apply some modifications to them. I was wondering if this is easily done (preferably without external libraries). I have no experience with reading in sound files, so I don't know much about the subject.
推荐答案
WAV文件(至少,uncom pressed的)是相当简单的。有一个头,然后将数据跟随它。
WAV files (at least, uncompressed ones) are fairly straightforward. There's a header, then the data follows it.
下面是一个很好的参考:<击> https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ (<一href=\"https://web.archive.org/web/20141213140451/https://ccrma.stanford.edu/courses/422/projects/WaveFormat/\">mirror)
Here's a great reference: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ (mirror)
这篇关于如何在wav文件中的数据读出到一个数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!