diff options
Diffstat (limited to 'voice-to-text')
-rwxr-xr-x | voice-to-text | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/voice-to-text b/voice-to-text new file mode 100755 index 0000000..6dadaac --- /dev/null +++ b/voice-to-text @@ -0,0 +1,15 @@ +#!/bin/sh + +#pip install vosk --break-system-packages +#Download model for vosk on https://alphacephei.com/vosk/models +#sudo pacman -S chatblade +#pip install piper-tts --break-system-packages +#Download model for piper on https://huggingface.co/rhasspy/piper-voices + +export OPENAI_API_KEY=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 + +ffmpeg -y -f alsa -i default -acodec pcm_s16le -ac 1 -ar 44100 -t 4 -f wav ~/.cache/audio.wav >/dev/null 2>&1 +vosk-transcriber -m vosk-model-small-ru-0.22 -i ~/.cache/audio.wav -o ~/.cache/transcript.txt >/dev/null 2>&1 +chatblade -e $(cat ~/.cache/transcript.txt) > ~/.cache/response.txt +cat ~/.cache/response.txt +cat ~/.cache/response.txt | piper --model ru_RU-irina-medium.onnx --output-raw | aplay -r 22050 -f S16_LE -t raw - |