gpt4 book ai didi

python - 属性错误 : module 'librosa' has no attribute 'output'

转载 作者:行者123 更新时间:2023-12-03 00:23:26 32 4
gpt4 key购买 nike

我在 anaconda 中使用 librosa 0.6 并且我还安装了 ffmpeg 但我仍然收到此错误
代码是

a = np.exp(spectrum) - 1
p = 2 * np.pi * np.random.random_sample(spectrum.shape) - np.pi
for i in range(50):
S = a * np.exp(1j * p)
x = librosa.istft(S)
p = np.angle(librosa.stft(x, N_FFT))
librosa.output.write_wav(outfile, x, sr)

最佳答案

你可以改用这个

import soundfile as sf
sf.write('stereo_file1.wav', reduced_noise, 48000, 'PCM_24')
在这里查看更多 https://pysoundfile.readthedocs.io/en/0.8.1/#soundfile.write

关于python - 属性错误 : module 'librosa' has no attribute 'output' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63997969/

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