gpt4 book ai didi

audio - 导入python时位深度检测错误

转载 作者:行者123 更新时间:2023-12-03 01:13:45 25 4
gpt4 key购买 nike

我正在尝试将音频导入python。据我所知,该文件是16位的。我还使用Matlab对其进行了验证:

audioinfo('C:\Users\gideo\OneDrive\Desktop\records\shluhotShifa\13.6_1020_high_infected_shluhot_shifa.wav')

ans =

struct with fields:

Filename: 'C:\Users\gideo\OneDrive\Desktop\records\shluhotShifa\13.6_1020_high_infected_shluhot_shifa.wav'
CompressionMethod: 'Uncompressed'
NumChannels: 2
SampleRate: 12400
TotalSamples: 75175584
Duration: 6.0625e+03
Title: []
Comment: []
Artist: []
BitsPerSample: 16
当我尝试使用Python进行操作时:
from scipy.io.wavfile import read
read(r'C:\Users\gideo\OneDrive\Desktop\records\shluhotShifa\13.6_1020_high_infected_shluhot_shifa.wav')
我懂了
Traceback (most recent call last):

File "<ipython-input-1-f05807318730>", line 2, in <module>
read(r'C:\Users\gideo\OneDrive\Desktop\records\shluhotShifa\13.6_1020_high_infected_shluhot_shifa.wav')

File "C:\ProgramData\Anaconda3\lib\site-packages\scipy\io\wavfile.py", line 298, in read
"has {}-bit data.".format(bit_depth))

ValueError: Unsupported bit depth: the wav file has 12-bit data.
如何将数据导入python?

最佳答案

实际上文件是16位的,而标题是12位的。 header 已更改,一切运行良好

关于audio - 导入python时位深度检测错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63110710/

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