gpt4 book ai didi

python-2.7 - 意外的文件 wavfile.read python 结尾

转载 作者:行者123 更新时间:2023-12-01 00:22:33 24 4
gpt4 key购买 nike

我正在尝试通过以下代码读取 .wav 音频文件

from scipy.io import wavfile
file = 'PC1_20090513_050000_0010.wav'
rate, audio = wavfile.read(file)

但它显示以下错误:
raise ValueError("Unexpected end of file.")
ValueError: Unexpected end of file.

任何的想法 ??

最佳答案

您似乎在 wav 文件( http://soundfile.sapp.org/doc/WaveFormat/ )的头部得到了不正确的数据。 VLC 有时可以处理。
尝试使用任何软件重新保存此文件。例如,使用 sox ( http://sox.sourceforge.net/ ) 并重新采样到相同的频率(像这样: sox.exe wav_file -r frequency out_wav_file )

关于python-2.7 - 意外的文件 wavfile.read python 结尾,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47419836/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com