当前位置:AIGC资讯 > AIGC > 正文

OpenAI之Whisper实时语音分析转文字

1.安装ffmpeg

2.安装python3.11

3.安装whisper

pip install whisper

conda环境安装whisper

 conda install whisper

命令行安装openai-whisper

pip install openai-whisper

设置环境变量

 4.分析语音并输出(默认使用GPU计算,如果没有安装CUDA,请使用CPU)

 whisper ./test.m4a --model small --output_format srt --language Chinese

5.使用CPU计算分析音频并输出

whisper ./test.m4a --model small --output_format srt --language Chinese --device cpu

 CPU分析音频会比GPU慢

使用python脚本操作whisper:

更新时间 2024-07-09