You are browsing as a guest. Sign up (or log in) to start making projects!

55m 34s logged

Faster response speed thanks to streaming audio

  • Ok so ollama’s ChatResponse class allows, when creating an instance of it, to write stream = True.
  • So I could stream the outputted response directly into Piper TTS and into the speakers.
  • Except it would sound very weird, very robotic-like since the chatbot outputs tokens, not words. I then created a function called sentence_buffer() that seperates them into a list of words, that are then given to Piper TTS in speaker.py
  • Then I used a library called pyaudio to stream the Piper TTS output into the speakers! it’s actually just a Python wrapper for a C library called portaudio, so I ran into a LOT of dependency issues, but that’s a battle for another day.
  • Moved a few functions that were in main.py into other files for better management
  • Other small modifications
1
12

Comments 0

No comments yet. Be the first!