我对 jupyter notebook 有点陌生,我试图改变一些 mp3 文件的采样率:
sample = train_df.iloc[np.random.randint(0, len(train_df))]
path = sample["path"]
path = os.path.join(path)
print(path)
print(sample["sentence"], "\n")
speech = torchaudio.load(path)
speech = speech[0].numpy().squeeze()
speech = librosa.resample(np.asarray(speech), 48_000, 16_000)
ipd.Audio(data=np.asarray(speech), autoplay=True, rate=16000)
但我在尝试读取 mp3 文件时收到以下错误:
RuntimeError:打开“D:/Apps/Common/content/cv-corpus-6.1-2020-12-11/fa/clips/common_voice_fa_19399474.mp3”时出错:文件包含未知格式的数据。
有小费吗?