Python Telegram Bot 中的音频片段库
Audio Segment Library in Python Telegram Bot
我需要使用音频片段库将音频转换为文本 我安装了它,但它在我 运行 项目运行时显示警告,但它不起作用:
RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
sound = AudioSegment.from_ogg('user.ogg')
sound.export('user.wav', format="wav")
r = sr.Recognizer()
with sr.AudioFile("user.wav") as source:
audio = r.record(source)
text = r.recognize_google(audio)
print(text)
Note: It was working before I format my computer ,But when I try to reinstall it ,The Message Appears.
我需要您的帮助
谢谢你...
打开ffmpeg页面时,不要选择下载代码的选项。相反,选择安装 .exe 文件。完成后,您将在 ffmpeg 文件夹内的 bin 文件夹中看到 ffmpeg.exe。最后将bin文件夹的路径放入PATHsystem/user变量中
我需要使用音频片段库将音频转换为文本 我安装了它,但它在我 运行 项目运行时显示警告,但它不起作用:
RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
sound = AudioSegment.from_ogg('user.ogg')
sound.export('user.wav', format="wav")
r = sr.Recognizer()
with sr.AudioFile("user.wav") as source:
audio = r.record(source)
text = r.recognize_google(audio)
print(text)
Note: It was working before I format my computer ,But when I try to reinstall it ,The Message Appears.
我需要您的帮助 谢谢你...
打开ffmpeg页面时,不要选择下载代码的选项。相反,选择安装 .exe 文件。完成后,您将在 ffmpeg 文件夹内的 bin 文件夹中看到 ffmpeg.exe。最后将bin文件夹的路径放入PATHsystem/user变量中