简体   繁体   English

.wav问题和python wave

[英].wav questions and python wave

The module "wave" of python gives me a list of hexadecimal bytes, that I can read like numbers. python的模块“ wave”为我提供了一个十六进制字节列表,我可以像读取数字一样阅读。 Let's say the frequency of my sample is 11025. Is there a 'header' in those bytes that specify this? 假设我的采样频率为11025。那些字节中是否有一个“ header”来指定? I know I can use the wave method to get the frequency, but I wanna talk about the .wav file structure. 我知道我可以使用wave方法获取频率,但是我想谈一谈.wav文件结构。 It has a header? 它有标题吗? If I get those bytes, how do I know wich ones are the music and the ones that are information? 如果我得到这些字节,我怎么知道音乐和信息是最重要的? If I could play these numbers in a speaker 11025 times per second with the intensity from 0 to 255, could I play the sound just like it is in the file? 如果我可以在扬声器中以0到255的强度每秒播放11025次这些数字,是否可以像文件中一样播放声音?

Thanks! 谢谢!

.wav files are actually RIFF files under the hood. .wav文件实际上是RIFF文件。 The WAVE section contains both the format information and the waveform data. WAVE部分包含格式信息和波形数据。 Reading the codec, sample rate, sample size, and sample polarity from the format information will allow you to play the waveform data assuming you support the codec used. 从格式信息中读取编解码器,采样率,采样大小和采样极性,可以在假设您支持所用编解码器的情况下播放波形数据。

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

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