Skip to content

Instantly share code, notes, and snippets.

@mknz
Created February 28, 2023 16:27
Show Gist options
  • Save mknz/647f310baac209b6e142aa10e956e807 to your computer and use it in GitHub Desktop.
Save mknz/647f310baac209b6e142aa10e956e807 to your computer and use it in GitHub Desktop.
Record audio, transcribe and copy to clipboard
#!/bin/bash
arecord -r 16000 -c 1 -f S16_LE -d 5 /tmp/tmp.wav &> /dev/null
./main -m ./models/ggml-base.bin -l en -f /tmp/tmp.wav -otxt -of /tmp/out &> /dev/null
python -c "import pyperclip; pyperclip.copy(open('/tmp/out.txt', 'r').read().replace('\n', ' ').strip())"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment