$ more /proc/asound/cards
0 [ALSA ]: bcm2835 - bcm2835 ALSA
bcm2835 ALSA
1 [Device ]: USB-Audio - USB PnP Audio Device
USB PnP Audio Device at usb-3f980000.usb-1.4, full speed
# more /proc/asound/cards
0 [seeed2micvoicec]: seeed-2mic-voic - seeed-2mic-voicecard
seeed-2mic-voicecard
#
A lot of times when sound applications seem to fail, it is because we forget to turn up the volume.
Volume adjustment can be done with alsamixer
. This program makes use of some
function keys (F1
, F2
, etc).
$ alsamixer
F6
to select between sound cards
F3
to select playback volume (for speaker)
F4
to select capture volume (for mic)
⬆
⬇
arrow keys to adjust
Esc
to exit
$ speaker-test -t wav
Press Ctrl-C
when done.
Enter this command, then speak to the mic, press Ctrl-C
when you are
finished:
$ arecord -D plughw:0,0 abc.wav
-D plughw:0,0
tells arecord
where the device is. In this case, device is
the mic. It is at index 0.
plughw:1,0
actually refers to "Sound Card index 1, Subdevice 0", because a
sound card may house many subdevices. Here, we don't care about subdevices and
always give it a 0
. The only important index is the sound card's.
$ aplay -D plughw:0,0 abc.wav
Here, we tell aplay
to play to plughw:0,0
, which refers to "Sound Card index 0,
Subdevice 0", which leads to the speaker.
If you aplay
and arecord
successfully, that means the speaker and microphone
are working properly. We can move on to add more capabilities.
$ pico2wave -w abc.wav "Good morning. How are you today?"
$ aplay -D plughw:0,0 abc.wav
$ pocketsphinx_continuous -adcdev plughw:0,0 -inmic yes
$ pocketsphinx_continuous -adcdev plughw:0,0 -hmm /usr/share/pocketsphinx/model/lm/ru/zero_ru.cd_semi_4000/ -jsgf /root/assist/speech/gr.gram -dict /root/assist/speech/ru.dic -inmic yes
pocketsphinx_continuous
interprets speech in real-time. It will spill out
a lot of stuff, ending with something like this:
Warning: Could not find Capture element
READY....
Now, speak into the mic, and note the results. At first, you may find it funny. After a while, you realize it is horribly inaccurate.
For it to be useful, we have to make it more accurate.
echo "Система умного вигвама приветствует вас" | RHVoice-test -p Anna
espeak "Text you wish to hear back"
espeak "Text you wish to hear back" -w test.wav
aplay test.wav
espeak -vru "Русский синтезатор речи"
spd-say -o rhvoice -t female1 "hello"
echo "Проверка синтезатора речи2" | spd-say -o rhvoice -l ru -e -t male1
python3 demo.py resources/models/jarvis.umdl