å ¬å¼ã¯ãã¡ãã
Windowsã®WSLã§Ubuntuãå ¥ã£ã¦ããåæã
Powershellãèµ·åã
wsl
ã¨å ¥åãUbuntuã«åãæ¿ãã
ffmpegã®ã¤ã³ã¹ãã¼ã«
Whisper.cppã§ã¯ç¾ç¶ãwavãã¡ã¤ã«ããæ±ããªãã®ã§ãffmpegãã¤ã³ã¹ãã¼ã«ã
sudo apt install ffmpeg
ãã«ã
git clone https://github.com/ggerganov/whisper.cpp.git
cd whisper.cpp
make
使ç¨ããã¢ãã«ããã¦ã³ãã¼ã
./models/download-ggml-model.sh âã¢ãã«åâ
å©ç¨å¯è½ãªã¢ãã«ã¯ãã¡ãã largeãä¸çªæ§è½ãããããã¡ã¢ãªçã®æ§è½ãå¿ è¦ã
large-v3ã®å ´åã¯ä»¥ä¸ã®ããã«ã
./models/download-ggml-model.sh large-v3
以ä¸ã§ã¤ã³ã¹ãã¼ã«ã確èªã
./main -h
PATHãéã
whispers.cppãã©ã«ãã®å ´æã確èªããPATHãéããä¸ã¯ä¸ä¾ã
sudo nano ~/.profile
㧠~/.profile ãã¡ã¤ã«ãéããããæå¾ã®è¡ã«ãwhispers.cppãã©ã«ãã®å ´æã追å ãã¦ã¼ã¶ã¼åã®ã¨ããã¯é©å®å¤æ´ãã
PATH=$PATH:/mnt/c/Users/ã¦ã¼ã¶ã¼å/whispers.cpp
追å ããã ãã§ã¯åæ ãããªãã®ã§ã以ä¸ãå®è¡ã
source ~/.profile
以ä¸ã§ãPATHãéã£ããã¨ã確èªã
echo $PATH | grep whisper.cpp
ããã§ããããwhispers.cppãã©ã«ãã«ç§»åãã¦ããã./main
ãããªãã¦ããé³å£°ãã¡ã¤ã«ããããã©ã«ãå
ã§å³ã¯ãªãã¯ï¼ã¿ã¼ããã«ã§éãï¼Powershellèµ·åï¼ãwslãã§Ubuntuèµ·åã㧠main
ã§èµ°ãã
é³å£°ãwavã«å¤æ
Whisper.cppã¯wavãã¡ã¤ã«ã«ãã対å¿ãã¦ããªãã®ã§ã
ffmpeg -i input.mp3 -ar 16000 -ac 1 -c:a pcm_s16le output.wav
é³å£°ãåå²
é³å£°ãé·ãã¨ã¨ã©ã¼ãåºãã¨ãã«ãã¨ã©ã¼ã«ã¼ãã«ãªã£ã¦ãã¾ãããã以éèªèãã¦ãããªããªããããªã®ã§ãçãé³å£°ã«åå²ããã以ä¸ã¯é³å£°ã1åãã¨ã«åå²ã
ffmpeg -i input.wav -f segment -segment_time 60 -c copy output_%03d.wav
å®è¡ï¼é³å£°ãæåèµ·ããï¼
ä¾ãã°ãlarge-v3ï¼WSLããã ã¨ãã¦ã³ãããC:ã®ä¸ã®ãUsers/ã¦ã¼ã¶ã¼å/whisper.cpp/models/ã«ããã®ã§ã/mnt/c/ï½
ãå¿
è¦ã«ãªãããã¦ã¼ã¶ã¼åãã®ã¨ããã¯é©å®å¤æ´ã®ãã¨ï¼ã使ã£ã¦ãwavãã¡ã¤ã«ãæåèµ·ããããå ´åã
wavãã¡ã¤ã«ã®ãããã©ã«ãå ã§å³ã¯ãªãã¯ï¼ã¿ã¼ããã«ã§éãï¼Powershellèµ·åï¼ãwslãã§Ubuntuèµ·åãã¦
main -m "/mnt/c/Users/ã¦ã¼ã¶ã¼å/whisper.cpp/models/ggml-large-v3.bin" -f output.wav -l ja -otxt
ä¸è¨ã¯ãlargeãã¢ãã«ã使ç¨ãã¦ããå ´åãªã®ã§ãä»ã®ã¢ãã«ã使ãã¨ã¯é©å®å¤æ´ãã
ããã¹ãçµå
ãã£ã¬ã¯ããªå ã®ããã¹ããã¡ã¤ã«ããã¹ã¦çµåãã¦ããã¼ãèµ·ãã.txtã¸ã
cat *.txt > ãã¼ãèµ·ãã.txt