summaryrefslogtreecommitdiff
path: root/voice-to-text
diff options
context:
space:
mode:
authorAlisaLinUwU <alisalinuwu@gmail.com>2025-01-26 10:46:24 +0500
committerAlisaLinUwU <alisalinuwu@gmail.com>2025-01-26 10:46:24 +0500
commit0809ccaf6b39039f5eb6fcbbf63f15f24bff5c7d (patch)
tree72c75171af79914ff0f4636ac31879afe82ff32d /voice-to-text
Initializemain
Diffstat (limited to 'voice-to-text')
-rwxr-xr-xvoice-to-text15
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 -