.. | ||
chat | ||
.gitignore | ||
.python-version | ||
Readme.md | ||
requirements.txt |
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:
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/