Test after installation

Hello Johannes and Michael,

I am very happy with Rhasspy but I have decided I would try voice2json.

I have installed the Docker image successfully and downloaded the en-us_pocketsphinx-cmu profile for a start. I should have created a specific folder as I will add one for French later (I expected that would be similar to the Rhasspy installation which created an ‘en’ folder by default).

Anyway, I have “trained” my profile and wanted to test it with voice2json transcribe-stream but card 0 is apparently expected where my microphone is card 2.

pi@raspberrypi:~ $ voice2json transcribe-stream
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2564:(snd_pcm_open_noupdate) Unknown PCM default
arecord: main:828: audio open error: No such file or directory
Ready

Where can I switch the card?

Thanks!

Jean-Claude

You can use transcribe stream with audio input from stdin for a bit more control. This way you can use Unix pipes to pipe the audio output of any command you like to voice2json.
Something like:

arecord -q -D plughw:2,0 -t raw -r 16000 -f S16_LE -c 1 | voice2json --profile /path/to/your/profile transcribe-stream --audio-source -

Where -D plughw:2,0 could also be -D array :wink:
Or you define the record command in the profile.yml in the folder of the downloaded profile:

audio:
  # Command to execute to record raw 16-bit 16Khz mono audio
  record-command: "arecord -q -D plughw:2,0 -t raw -r 16000 -f S16_LE -c 1"

The first option to use audio from stdin is very useful for testing and in general in combination with the docker installation as the record command actually happens on the host this way which takes out all the complications and headaches of trying to access hostaudio hardware with fine grained control from within docker.

1 Like

Thank you Johannes,

I’ve had no difficulty to come to this running fine on the base of some of your examples.

This is still a quick and dirty thing and I need to work further of course.

This is a great stuff!

PS: And you know what? I’ve used -t alsa array in sox-record and your dsnoop settings in asound.conf :wink:

1 Like