What exactly is the data returned when reading a .wav file?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-19 09:46:29

问题


When reading a audio file using something such as

rate, wavData = scipy.io.wavfile.read('test.wav')

what exactly does the data inside of wavData represent?


回答1:


wavData is an array of numbers each representing a single sample of the audio signal. The samples are snapshots of the audio amplitude spaced evenly in time. So if your rate is returned as 48000 then the first 48000 elements of wavData would be 1 second worth of the audio signal. For more information read about PCM on wikipedia: https://en.wikipedia.org/wiki/Pulse-code_modulation.



来源:https://stackoverflow.com/questions/33640274/what-exactly-is-the-data-returned-when-reading-a-wav-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!