From 0809ccaf6b39039f5eb6fcbbf63f15f24bff5c7d Mon Sep 17 00:00:00 2001 From: AlisaLinUwU Date: Sun, 26 Jan 2025 10:46:24 +0500 Subject: Initialize --- voice-to-text | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 voice-to-text (limited to 'voice-to-text') 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 - -- cgit v1.2.3