python - 尽管下载了ffmpeg并设置了路径变量python,但没有后端错误
问题描述
我在使用 librosa 模块打开音频文件的 python 代码中没有后端错误。我已经下载了 ffmpeg 并设置了环境,但我仍然没有收到后端错误。我在 .mp3 扩展名中收到此错误,而 wav 则正常工作。
import librosa as lib
t,s_r=lib.load(r"C:\songs\03-BuddhuSaMann-DownloadMing.SE.mp3")
这是我得到的错误:
用户警告:PySoundFile 失败。尝试使用audioread。warnings.warn('PySoundFile 失败。尝试使用 audioread。')
RuntimeError:打开“C:\songs\03-BuddhuSaMann-DownloadMing.SE.mp3”时出错:文件包含未知格式的数据。在处理上述异常的过程中,又出现了一个异常:
无后端错误:
解决方案
请尝试以下操作:https ://stackoverflow.com/a/63480393/7999026以确保您的文件没有损坏。如果不是并且librosa
仍然失败,您可以尝试使用scipy
.
from scipy.io import wavfile
t,s_r = wavfile.read(r"C:\songs\03-BuddhuSaMann-DownloadMing.SE.mp3")
推荐阅读
- node.js - NPM安装问题:未知系统错误-75
- c - 在 C 中使用双指针 (char**) 与 (char*) 的优势?
- oauth-2.0 - 使用一台 SSO 服务器进行多协议身份验证
- spring-boot - Spring Cloud Config 刷新配置
- android - 如何拥有与物理设备相同 UI 的模拟器
- python - 试图在Python中获取数组中的所有素数
- visual-studio - 如何在excel中注册自定义函数添加到不同的视图
- python - Python 可以看到 `json` 模块,但 pipenv 没有。为什么?
- pyspark - pyspark 加入两个 rdd 并将结果展平
- android - Google Analytics(分析)屏幕跟踪的“屏幕名称”是否区分大小写?