如何将wav文件中的数据读入数组 [英] How to read the data in a wav file to an array

查看:28
本文介绍了如何将wav文件中的数据读入数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将 wav 文件的所有样本放入一个数组中(如果您需要这样做以保持立体声,则需要两个),以便我可以对它们进行一些修改.我想知道这是否容易完成(最好没有外部库).我没有阅读声音文件的经验,所以我对这个主题了解不多.

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 文件(至少是未压缩的文件)相当简单.有一个标题,然后是数据.

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/ (镜像)

Here's a great reference: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ (mirror)

这篇关于如何将wav文件中的数据读入数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆