Sign inSign up

janvda/rhasspy

By janvda

Updated over 2 years ago

Image
0

704

janvda/rhasspy repository overview

rhasspy

GitHub location: janvda/my-google-voice-kit/rhasspy

This service is based on the rhasspy docker image.

It has been extended to support pulseaudio and provides also the utilities: pavucontrol, htop, ps, nano.

Docker Volumes

/profiles

All rhasspy configuration settings are saved under /profiles folder.

Change History

  • version 1.1.1 : rebuild version 1.1.0
  • version 1.1.0 : also build for architecturelinux/arm64/v8
  • version 1.0.0 : also build for architecture linux/amd64
  • version 0.0.2 : rebuild for linux/arm/v7
  • version 0.0.1 : initial version only for linux/arm/v7

configuration

Web Interface

Rhasspy comes with a powerfull web UI (URL: http:<hostname>:12101) allowing to configure the different rhasspy services.

configure a new snowboy wake word

The steps to configure a new snowboy wake word that is generated by snowboy-seasalt service

Assume the new snowboy wake word has the name stemija_macbook_20231026.pmdl

  1. In directory /profiles/en create a sub directory snowboy
  2. copy stemija_macbook_20231026.pmdlto this sub directory
# command to copy a local file into a container
# FYI with command `docker ps` you can find the container id of the rhasspy service.
docker cp stemija_macbook_20231026.pmdl cdebc96fa0fb:/profiles/en/snowboy/
  1. Using the rhasspy web interface change wake word system to snowboy
  2. restart the rhasspy container
  3. Using the rhasspy web interface specify stemija_macbook_20231026.pmdl as Model and set the sensitivy (e.g. set it 0.5)
  4. save the settings.

Your rhasspy profile should look like:

    "wake": {
        "snowboy": {
            "model": "stemija_macbook_20231026.pmdl",
            "sensitivity": "0.5"
        },
        "system": "snowboy"
    }
Setting audio volume

Volume can be set at 2 levels:

  • sink level
  • sink-input level
Setting audio volume at sink level

With following command you can check the sink audio volume:

pactl list sinks

With following command you set the audio volume of sink 8 to 100%

pactl -- set-sink-volume 8 100%

You can use following speaker-test command to test this:

speaker-test -t wav -c 6
Setting audio volume at sink-input level

Use the controller ui for this.

Alternatively you can also do it using following pactl commands:

#  to get the volume of the sink-inputs
pactl list sink-inputs

# to set the volume of a sink-input
pactl set-sink-input-volume #N VOLUME
Audio Recording

Use arecord with Device pulse- so select PulseAudio Sound Server (pulse) in drop down list.

Testing Audio

pactl info
root@b0e9b39a2c20:/# pactl info
Server String: /tmp/pulse_socket
Library Protocol Version: 32
Server Protocol Version: 32
Is Local: yes
Client Index: 33
Tile Size: 65496
User Name: pulseaudio
Host Name: pi3three
Server Name: pulseaudio
Server Version: 12.2
Default Sample Specification: s16le 2ch 48000Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.default
Default Source: alsa_input.default
Cookie: cddb:2233
root@b0e9b39a2c20:/# 
speaker-test
root@dfdfbb06d5a9:/tmp# speaker-test -t wav -c 6

speaker-test 1.1.8

Playback device is default
Stream parameters are 48000Hz, S16_LE, 6 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 32 to 349525
Period size range from 10 to 116509
Using max buffer size 349524
Periods = 4
was set period_size = 87381
was set buffer_size = 349524
 0 - Front Left
 4 - Center
 1 - Front Right
 3 - Rear Right
 2 - Rear Left
 5 - LFE
Time per period = 9.009266
arecord
root@b0e9b39a2c20:/# arecord -L
default
    Playback/recording through the PulseAudio sound server
null
    Discard all samples (playback) or generate zero samples (capture)
jack
    JACK Audio Connection Kit
pulse
    PulseAudio Sound Server
sysdefault:CARD=sndrpigooglevoi
    snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
    Default Audio Device
dmix:CARD=sndrpigooglevoi,DEV=0
    snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
    Direct sample mixing device
dsnoop:CARD=sndrpigooglevoi,DEV=0
    snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
    Direct sample snooping device
hw:CARD=sndrpigooglevoi,DEV=0
    snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
    Direct hardware device without any conversions
plughw:CARD=sndrpigooglevoi,DEV=0
    snd_rpi_googlevoicehat_soundcar, Google voiceHAT SoundCard HiFi voicehat-codec-0
    Hardware device with all software conversions
usbstream:CARD=sndrpigooglevoi
    snd_rpi_googlevoicehat_soundcar
    USB Stream Output
root@b0e9b39a2c20:/# arecord -f S16_LE -d 5  -r 16000 /tmp/test-mic.wav
Recording WAVE '/tmp/test-mic.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
root@b0e9b39a2c20:/# aplay /tmp/test-mic.wav
Playing WAVE '/tmp/test-mic.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
root@b0e9b39a2c20:/# 

Tag summary

Content type

Image

Digest

sha256:786197a17

Size

626.1 MB

Last updated

over 2 years ago

docker pull janvda/rhasspy