【whisper】使用whisper实现语音转文字

whisper需要ffmpeg支持

官网下载ffmpeg

cpp 复制代码
https://www.gyan.dev/ffmpeg/builds/

下载完毕后解压放到合适的位置

添加环境变量

在cmd中输入以下

cpp 复制代码
ffmpeg -version

出现下面结果代表成功

安装whisper

cpp 复制代码
pip install openai-whisper

在vscode中运行

测试代码

cpp 复制代码
import whisper

if __name__ == '__main__':
    # 加载模型
    model = whisper.load_model("large")
    audio_path = 'Asset2021_10_23\\test_audio_2024_09_01.aac'
    result = model.transcribe(audio_path, fp16=True, language="Chinese")
    print(result["text"])
相关推荐
言京谅3 天前
Jetson 部署 Faster Whisper
人工智能·whisper·语音识别·jetson nano
@我们的天空8 天前
【AIGC】Whisper语音识别模型概述,应用场景和具体实例及如何本地搭建Whisper语音识别模型?
人工智能·python·深度学习·机器学习·whisper·aigc·语音识别
AI逍遥子9 天前
如何本地搭建Whisper语音识别模型
人工智能·whisper·语音识别·ai编程
不会代码的小林12 天前
如何本地搭建Whisper语音识别模型
whisper
营赢盈英13 天前
OpenAI transcription API bad request
javascript·ai·node.js·whisper·axios·openai api
LQS202013 天前
本地搭建和运行Whisper语音识别模型小记
whisper
营赢盈英14 天前
Python Poetry fails to add openai-whisper due to triton installation error
python·ai·whisper·openai·poetry
一只老虎14 天前
本地搭建 Whisper 语音识别模型实现实时语音识别研究
人工智能·whisper·语音识别
营赢盈英14 天前
OpenAI Whisper API (InvalidRequestError)
python·ai·whisper·fastapi·openai api