ILikeAI / AlwaysReddy

AlwaysReddy is a LLM voice assistant that is always just a hotkey away.
MIT License
621 stars 61 forks source link

Piper missing? #33

Closed POD319 closed 4 months ago

POD319 commented 4 months ago

Trying to use Piper TTS but I was getting a file not found error. Traced that back and it seems there's supposed to be a piper.exe file in piper_tts folder.

I went to here: https://github.com/rhasspy/piper and moved some of those files in piper_tts, but it doesn't seem to be outputting the temp file in audio_files.

Stopped to write this up to make sure I'm not missing something. Should piper be acting this way, or did I miss some dependency perhaps?

sammcj commented 4 months ago

I tried out the app and hit this problem as well.

Starting recording...
Recording started...
Playing sound FX: sounds/recording-start
use_clipboard: False
^R
Stopping recording...
Playing sound FX: sounds/recording-end
Recording saved to audio_files/temp_recording.wav
Transcribing audio file: audio_files/temp_recording.wav
Detected language: en with probability 1.00

Transcription:
 Tell me a joke about llamas.
dyld[66163]: Library not loaded: @rpath/libespeak-ng.1.dylib
  Referenced from: <65D01FDC-B71E-3786-8B0D-0BFEEC801633> /Users/samm/git/AlwaysReddy/piper_tts/piper
  Reason: tried: '/usr/local/lib/libespeak-ng.1.dylib' (no such file), '/usr/lib/libespeak-ng.1.dylib' (no such file, not in dyld cache)
Piper TTS command executed successfully.
Running TTS: Why did the llama refuse to play poker?
Adding to queue
Error playing audio:
dyld[66166]: Library not loaded: @rpath/libespeak-ng.1.dylib
  Referenced from: <65D01FDC-B71E-3786-8B0D-0BFEEC801633> /Users/samm/git/AlwaysReddy/piper_tts/piper
  Reason: tried: '/usr/local/lib/libespeak-ng.1.dylib' (no such file), '/usr/lib/libespeak-ng.1.dylib' (no such file, not in dyld cache)
Piper TTS command executed successfully.
Running TTS: Because it always got fleeced!
Adding to queue
Completion successful. Full response: Why did the llama refuse to play poker?

Because it always got fleeced!
Error playing audio:

Response:
 Why did the llama refuse to play poker?

Because it always got fleeced!
ILikeAI commented 4 months ago

Hmmm odd, what OS are you guys on? Piper installs when you run the setup.py file, try running it again and make sure you are selecting yes when it asks if you want to install piper TTS. Let me know if this resolves it :)

sammcj commented 4 months ago

Fresh install:

git clone --depth=1 https://github.com/ILikeAI/AlwaysReddy.git
cd AlwaysReddy
uv venv; source .venv/bin/activate
uv pip install -r requirements.txt faster_whisper_requirements.txt
python setup.py                                                                                                                
config.py already exists. Do you want to overwrite it? This may be required after an update as new contents are added to the config file often.(y/n): y
Copied EXAMPLE.config to config.py
.env already exists. Do you want to overwrite it? (y/n): y
Copied .env.example to .env
Please open .env and enter your API keys
Do you want to install Piper local TTS? (y/n): y
Downloading from https://github.com/rhasspy/piper/releases/download/2023.11.14-2/piper_macos_aarch64.tar.gz
[==================================================] 100.00%
Download complete.
Extracting /Users/samm/git/AlwaysReddy/scripts/piper_macos_aarch64.tar.gz
Extraction complete.
Piper TTS setup completed successfully.
python main.py                                                                                                                 
Using faster-whisper model: tiny.en and device: cpu

Press 'alt+ctrl+r' to start recording, press again to stop and transcribe.
Double tap to the record hotkey to give AlwaysReddy the content currently copied in your clipboard.
Press 'alt+ctrl+e' to cancel recording.
Press 'alt+ctrl+w' to clear the chat history.
use_clipboard: False
^R
Starting recording...
Recording started...
Playing sound FX: sounds/recording-start
use_clipboard: False
^R
Stopping recording...
Playing sound FX: sounds/recording-end
Recording saved to audio_files/temp_recording.wav
Transcribing audio file: audio_files/temp_recording.wav
Detected language: en with probability 1.00

Transcription:
 Tell me a short joke about llamas.
dyld[86474]: Library not loaded: @rpath/libespeak-ng.1.dylib
  Referenced from: <65D01FDC-B71E-3786-8B0D-0BFEEC801633> /Users/samm/git/AlwaysReddy/piper_tts/piper
  Reason: tried: '/usr/local/lib/libespeak-ng.1.dylib' (no such file), '/usr/lib/libespeak-ng.1.dylib' (no such file, not in dyld cache)
Piper TTS command executed successfully.
Running TTS: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Adding to queue
Completion successful. Full response: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Error playing audio:

Response:
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

^CRecorder stopped by user.
POD319 commented 4 months ago

Yep, user error for me. I didn't realize setup.py was needed to install everything. I've been using a few versions so I think I haven't run this every time.

That brings me to a better question -- is there an easy way to 'update' this? Or do I need to download the repo and adjust my changes each time? Things like custom keybinds and config.py changes

ILikeAI commented 4 months ago
  • macOS 14.4.1
  • Python 3.12.3

Fresh install:

git clone --depth=1 https://github.com/ILikeAI/AlwaysReddy.git
cd AlwaysReddy
uv venv; source .venv/bin/activate
uv pip install -r requirements.txt faster_whisper_requirements.txt
python setup.py                                                                                                                
config.py already exists. Do you want to overwrite it? This may be required after an update as new contents are added to the config file often.(y/n): y
Copied EXAMPLE.config to config.py
.env already exists. Do you want to overwrite it? (y/n): y
Copied .env.example to .env
Please open .env and enter your API keys
Do you want to install Piper local TTS? (y/n): y
Downloading from https://github.com/rhasspy/piper/releases/download/2023.11.14-2/piper_macos_aarch64.tar.gz
[==================================================] 100.00%
Download complete.
Extracting /Users/samm/git/AlwaysReddy/scripts/piper_macos_aarch64.tar.gz
Extraction complete.
Piper TTS setup completed successfully.
  • Edit config.py to set piper, ollama, llama3
python main.py                                                                                                                 
Using faster-whisper model: tiny.en and device: cpu

Press 'alt+ctrl+r' to start recording, press again to stop and transcribe.
Double tap to the record hotkey to give AlwaysReddy the content currently copied in your clipboard.
Press 'alt+ctrl+e' to cancel recording.
Press 'alt+ctrl+w' to clear the chat history.
use_clipboard: False
^R
Starting recording...
Recording started...
Playing sound FX: sounds/recording-start
use_clipboard: False
^R
Stopping recording...
Playing sound FX: sounds/recording-end
Recording saved to audio_files/temp_recording.wav
Transcribing audio file: audio_files/temp_recording.wav
Detected language: en with probability 1.00

Transcription:
 Tell me a short joke about llamas.
dyld[86474]: Library not loaded: @rpath/libespeak-ng.1.dylib
  Referenced from: <65D01FDC-B71E-3786-8B0D-0BFEEC801633> /Users/samm/git/AlwaysReddy/piper_tts/piper
  Reason: tried: '/usr/local/lib/libespeak-ng.1.dylib' (no such file), '/usr/lib/libespeak-ng.1.dylib' (no such file, not in dyld cache)
Piper TTS command executed successfully.
Running TTS: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Adding to queue
Completion successful. Full response: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Error playing audio:

Response:
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

^CRecorder stopped by user.

Hmmm okay thats not ideal! Do you get the same issue using a hosted API for the LLM completions?

ILikeAI commented 4 months ago

Yep, user error for me. I didn't realize setup.py was needed to install everything. I've been using a few versions so I think I haven't run this every time.

That brings me to a better question -- is there an easy way to 'update' this? Or do I need to download the repo and adjust my changes each time? Things like custom keybinds and config.py changes

Awesome glad it was fixed! Yeah the update system is the worst part of this project right now, Ill try to think on a better way to set it up...