Last active
November 4, 2022 19:24
-
-
Save ggerganov/faf5268b54263a52f8e8ca65d37905bc to your computer and use it in GitHub Desktop.
Transcribe mic audio using Whisper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# record some raw audio | |
sox -d rec.wav | |
# resample to 16kHz | |
ffmpeg -y -i ./rec.wav -ar 16000 -ac 1 -c:a pcm_s16le ./rec16.wav > /dev/null 2>&1 | |
# run Whisper | |
echo "Processing ..." | |
./main -m models/ggml-base.en.bin rec16.wav -owts > /dev/null 2>&1 | |
# generate Karaoke video | |
source rec16.wav.wts > /dev/null 2>&1 | |
# play the video | |
ffplay -loglevel 0 -autoexit ./rec16.wav.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment