我在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)
发布于 2020-11-06 14:53:45
你可以用这个来代替
import soundfile as sf
sf.write('stereo_file1.wav', reduced_noise, 48000, 'PCM_24')
点击此处查看更多信息https://pysoundfile.readthedocs.io/en/0.8.1/#soundfile.write
发布于 2020-09-21 19:54:12
在librosa版本0.8.0中删除了librosa.output
。their changelog中记录了这一点。因此,您出现问题的最可能原因是您使用的是这个新版本的librosa (而不是0.6.x版)。您可以通过执行print(librosa.__version__)
进行验证。
使用moden librosa,您应该改用soundfile.write来编写音频输出。
https://stackoverflow.com/questions/63997969
复制