mjaskolski / AIVoiceChat

Low latency ai companion voice talk in 60 lines of code using faster_whisper and elevenlabs input streaming

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Seamless and real-time voice interaction with AI.

Uses faster_whisper and elevenlabs input streaming for low latency responses to spoken input.

πŸŽ₯ Watch a Demo Video

Note: The demo is conducted on a 10Mbit/s connection, so actual performance might be more impressive on faster connections.

voice_talk_vad.py - automatically detects speech

voice_talk.py - toggle recording on/off with the spacebar

πŸ›  Setup:

1. API Keys:

Replace your_openai_key and your_elevenlabs_key with your OpenAI and ElevenLabs API key values in the code.

2. Dependencies:

Install the required Python libraries:

pip install openai elevenlabs pyaudio wave keyboard faster_whisper numpy torch 

3. Run the Script:

Execute the main script based on your mode preference:

python voice_talk_vad.py

or

python voice_talk.py

πŸŽ™ How to Use:

For voice_talk_vad.py:

Talk into your microphone.
Listen to the reply.

For voice_talk.py:

  1. Press the space bar to initiate talk.
  2. Speak your heart out.
  3. Hit the space bar again once you're done.
  4. Listen to reply.

🀝 Contribute

Feel free to fork, improve, and submit pull requests. If you're considering significant changes or additions, please start by opening an issue.

πŸ’– Acknowledgements

Huge shoutout to:

About

Low latency ai companion voice talk in 60 lines of code using faster_whisper and elevenlabs input streaming


Languages

Language:Python 100.0%