简体   繁体   English

有没有办法找出wav文件是否未压缩pcm?

[英]Is there a way to find out if a wav file is uncompressed pcm or not?

I'm currently programming a game with an engine that uses python as a base. 我目前正在使用以python为基础的引擎来编写游戏。 Now I've stumbled upon the problem that I'm trying to play .wav files. 现在,我偶然发现了要播放.wav文件的问题。 As it does not work I looked into the routines there and found that it can only play uncompressed .wav files. 由于它不起作用,我查看了那里的例程,发现它只能播放未压缩的.wav文件。

Now my question is is (as I didn't find anything there on how to see it) there any way to see if a .wav file is compressed or uncompressed? 现在我的问题是(因为我没有找到任何有关如何查看它的信息)是否有任何方法可以查看.wav文件是否已压缩或未压缩? (currently it is only a guess that it is compressed but can't make sure) (目前只能猜测它已被压缩,但不能确定)

You can read the file header, byte 20-22 (PCM): Values other than 1 indicate some form of compression. 您可以读取文件头的字节20-22(PCM):1以外的值表示某种形式的压缩。 (details here: http://soundfile.sapp.org/doc/WaveFormat/ ). (详细信息在这里: http : //soundfile.sapp.org/doc/WaveFormat/ )。

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

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