ismail nur adli - 2020-05-10

Okay first i want to tell you the device i use

  • Raspberry pi 4
  • ReSpeaker 4Mic Array

I already read https://github.com/bambocher/pocketsphinx-python/issues/23 , so i follow the instruction to uninstall pulseaudio , becuase in the #23 i read "ERROR continuos.c" maybe when you builded sphinxbase the Raspberry choosed pulseaudio instead of ALSA . And yeah there is no error like that, and i change init.py to use ad_alsa instead of ad_pulse. Everything worked fine , i can do pocketsphinx_continuous ... (Using my lm and dict) in terminal and it work great, no error and 80% right recognition.

So i move to code in python, this when error happen, i use this code

> import os
> from pocketsphinx import LiveSpeech, get_model_path
> 
> model_path = '/home/pi/try/poketsphinx'
> 
> speech = LiveSpeech(
> audio_device='plughw:1,0',
> verbose=False,
> sampling_rate=16000,
> buffer_size=2048,
> no_search=False,
> full_utt=False,
> hmm=os.path.join(model_path, 'en-us-id'),
> lm=os.path.join(model_path, '0175.lm'),
> dic=os.path.join(model_path, '0175.dic')
> )
> 
> for phrase in speech:
> print(phrase)

There is no error output, but no single word recognized.. first i think my microphone broken, so i try using speech recognition and audacity, it can record my voice.. I was very helped with any help, I will follow any directions because i need this in my thesis...

Additional information:

pi@raspberrypi:~ $ arecord -l * List of CAPTURE Hardware Devices card 1: seeed4micvoicec [seeed-4mic-voicecard], device 0: bcm2835-i2s-ac10x-codec0 ac10x-codec.1-003b-0 [bcm2835-i2s-ac10x-codec0 ac10x-codec.1-003b-0] Subdevices: 1/1 Subdevice #0: subdevice #0 pi@raspberrypi:~ $ aplay -l * List of PLAYBACK Hardware Devices card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA] Subdevices: 7/7 Subdevice

0: subdevice #0 Subdevice #1: subdevice #1 Subdevice #2: subdevice #2 Subdevice #3: subdevice #3 Subdevice #4: subdevice #4 Subdevice #5:
subdevice #5 Subdevice #6: subdevice #6 card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: ALSA [bcm2835 ALSA], device 2: bcm2835 IEC958/HDMI1 [bcm2835 IEC958/HDMI1] Subdevices: 1/1 Subdevice

0: subdevice #15