Rhasspy 2 (v1)
Maintenance / update/install
sudo systemctl start/stop/status voice
https://rhasspy.readthedocs.io/en/latest/installation/#virtual-environment
Installation
- (clone le repo)
export PIP_VERSION="pip<=20.2.4”
./configure RHASSPY_LANGUAGE=fr --enable-in-place
make
With Gruut:
make install-init
- comment or delete all install-init in the makefile
source .venv/bin/activate
- install
onnxruntime
with pip fromhttps://github.com/synesthesiam/prebuilt-apps/releases
- install
phonetisaurus
with pip fromhttps://github.com/rhasspy/phonetisaurus-pypi/releases
- install gruut
https://github.com/rhasspy/gruut/releases/tag/v0.9.0
make install
in rhasspy dir
Without Gruut:
- Edit
setup.py
and answer "no" to gruut installation make install
in rhasspy dir
Microphone
sudo apt install pulseaudio
pactl list sinks
pactl set-default-sink 0
vim ~/.asoundrc
pcm.!default {
type asym playback.pcm { type plug slave.pcm “hw:0” }
capture.pcm { type plug slave.pcm “hw:1” }
}
- reboot
Commande rasp
- https://memodugeek.info/augmenter-la-taille-du-swap-sur-le-raspberry-pi/
Rhasspy 3 (v2)
ALSA
Lister les cartes audio:
arecord -l
aplay-l
Mettre par défaut une carte:
/etc/asound.conf
pcm.!default {
type plug
slave.pcm {
type hw
card 2
}
}
Config
programs:
mic:
arecord:
command: |
arecord -q -r 16000 -c 1 -f S16_LE -t raw -
adapter: |
mic_adapter_raw.py --rate 16000 --width 2 --channels 1
snd:
mplayer:
command: |
mplayer - -cache 1024 -volume 7 -rawaudio channels=1:rate=22050:samplesize=2 -demuxer rawaudio
adapter: |
snd_adapter_raw.py --rate 22050 --width 2 --channels 1
wake:
porcupine1:
command: |
.venv/bin/python3 bin/porcupine_stream.py --model "${model}" "${sensitivities}" --lang_model "${lang_model}"
template_args:
model: "${data_dir}/framboise_linux.ppn"
lang_model: "${data_dir}/porcupine_params_fr.pv"
sensitivities: "0.6"
asr:
whisper-cpp.client:
command: |
client_unix_socket.py var/run/whisper-cpp.socket
larynx2:
command: |
client_unix_socket.py var/run/vosk.socket
handle:
date_time:
command: |
bin/date_time.py
adapter: |
handle_adapter_text.py
ratatouille:
command: |
bin/converse.py "${url}"
adapter: |
handle_adapter_text.py
template_args:
url: "http://127.0.0.1:5555"
tts:
piper.client:
command: |
client_unix_socket.py var/run/piper.socket
servers:
asr:
whisper-cpp:
command: |
script/server "${data_dir}/ggml-small.bin"
vosk:
command: |
script/server "${data_dir}/vosk-model-fr-0.22"
tts:
piper:
command: |
script/server "${model}"
template_args:
model: "${data_dir}/fr-siwis-low.onnx"
pipelines:
default:
mic:
name: arecord
wake:
name: porcupine1
asr:
name: vosk.client
handle:
name: ratatouille
tts:
name: piper.client
snd:
name: mplayer
Customisation wake word
config/programs/wake/porcupine1/bin/porcupine_stream.py
if keyword_index >= 0:
os.system("/usr/bin/mplayer -volume 10 /srv/rhasspy/media/long-oiseau.mp3 &>/dev/null &")
write_event(
...
Tester tts
script/run bin/tts_speak.py 'Bonjour'
Tester ratatouille
echo "est-ce qu'il va pleuvoir de demain" | config/programs/handle/ratatouille/bin/converse.py http://10.10.10.11:5555