megaMUR_LG/chatbot
Lars Haferkamp c6e0a995be initial version of voice interaction with ChatGPT 2023-04-21 22:17:24 +02:00
..
chat initial version of voice interaction with ChatGPT 2023-04-21 22:17:24 +02:00
.gitignore initial version of voice interaction with ChatGPT 2023-04-21 22:17:24 +02:00
.python-version initial version of voice interaction with ChatGPT 2023-04-21 22:17:24 +02:00
Readme.md initial version of voice interaction with ChatGPT 2023-04-21 22:17:24 +02:00
requirements.txt initial version of voice interaction with ChatGPT 2023-04-21 22:17:24 +02:00

Readme.md

Setup and run

Within chat directory

pyenv local 3.8
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Install ESpeak, see below

Set config:

In chat folder copy file config-sample.json to new file with name config.json and set especially the OpenAI API Key, the other values can be kept as default.

See section "Recording Audio" for getting correct Device ID on Raspberry. You can execute record_audio.py to see a list of available devices with IDs.

Run:

Execute main.py e.g.

python -m main

Recording Audio

Python package PyAudio

Installed via pip

For more examples, e.g. conversion into MP3 see https://realpython.com/playing-and-recording-sound-python/#recording-audio

Raspberry Pi

Setup microphone and Device Id:

https://makersportal.com/blog/2018/8/23/recording-audio-on-the-raspberry-pi-with-python-and-a-usb-microphone

Speech Synthesis

Raspberry/Linux: Pico TTS

https://github.com/cyberbotics/picotts

Pico TTS for Raspberry: https://cstan.io/post/2020/03/pico-tts-unter-raspbian-uebersetzen/

Mac

ESpeak

See https://espeak.sourceforge.net/

Verbesserung: MBrola Voices für ESpeak (https://github.com/numediart/MBROLA)

Install

brew install espeak

Test

espeak -vde -p20 -k20 "Hallo Welt"

MBRola für Mac: https://github.com/pettarin/setup-festival-mbrola

Maybe Pico TTS could run on Mac

https://github.com/cyberbotics/webots/wiki/Pico-Compilation

Audio for Raspberry

https://naomiproject.github.io/docs/

Similar projects

https://github.com/anatolybazarov/oracle.sh