简体   繁体   English

错误:文件不以 RIFF id 开头

[英]Error: file does not start with RIFF id

This line of code is throwing an error:这行代码抛出错误:

import wave
...
wave.open('/path/to/wavfile/1a.wav', "rb")

The 1a.wav is in the NIST SPHERE format. 1a.wav 采用 NIST SPHERE 格式。 I don't have much experience with the wav formats, but is there anyway I could transform it into RIFF format so that I can open it with the "wave" library?我对 wav 格式没有太多经验,但无论如何我可以将其转换为 RIFF 格式,以便我可以使用“wave”库打开它?

Thank you in advance!先感谢您!

Use ffmpeg to convert.使用 ffmpeg 进行转换。 eg例如

ffmpeg -i test.wav -acodec pcm_s16le -ac 1 -ar 16000 out.wav

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

相关问题 wave.Error: file does not start with RIFF id - wave.Error: file does not start with RIFF id 无法将文件 file.wav 作为 WAV 打开,原因是:文件不以 RIFF id 开头 - Failed to open file file.wav as a WAV due to: file does not start with RIFF id pyglet.media.codecs.wave.WAVEFormatException:文件不是以RIFF ID开头 - pyglet.media.codecs.wave.WAVEFormatException: file does not start with RIFF id 将 mp3 转录为文本 (python) --> “RIFF id”错误 - Transcribing mp3 to text (python) --> “RIFF id” error 使用python下采样WAV RIFF文件 - Downsample wav RIFF file using python tensorflow 音频识别错误“标题不匹配:预期 RIFF 但找到” - tensorflow audio recognition error 'Header mismatch: Expected RIFF but found ' 由 PyDub AudioSegment.split_on_silence() 产生的 .WAV 音频在使用 wave.open 读取时没有 RIFF ID - .WAV Audio Produced by PyDub AudioSegment.split_on_silence() has no RIFF ID when reading with wave.open 错误字段`product_id`不存在 - Error Field `product_id` does not exist Django:从视图返回文件后下载未开始 - Django: download does not start after returnig a file from view 为什么另一个目录中文件的路径有时以“./”开头,有时以“../”开头 - Why does the path to a file in another dir start sometimes with “./” and sometimes with “../”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM