I have pocketsphinx compiled on a geode i586-linux. When I tried the sample
input files, pocket_continuous runs correctly. However, when I run it using
the microphone input, it doesn't recognize the start of speech and is stuck at
the Ready state. I suspect that it's because the sampling rate is 48kHz
instead of the required 16kHz and there are 4 channel inputs (when I use
arecord) and I can't switch to mono channel input. I am not sure how I can
resolve the problem of a different sampling rate and 4 channel inputs. Anyone
has any idea?
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It doesn't seem that sampling rate matters, you just need to record from a
proper device. You can test with arecord which one works. You can select
devices in pocketsphinx using -adcdev option. If pocketsphinx is compiled with
alsa that would be alsa device name. With pulseaudio it will be pulseaudio
device name. With OSS you need to point a dsp device file.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I did that. However, it gave me an error: Failed to set PCM device to
mono: Invalid argument
FATAL_ERROR: "continuous.c", line 242: Failed top open audio device
after I tried executing this: ./pocketsphinx_continuous -adcdev hw:0,0 -hmm
~/model/hmm/en_US/hub4wsj_sc_8k -lm ~/model/lm/en/turtle.DMP -dict
~/model/lm/en/turtle.dic
I have no idea how to set alsa device to mono. It seems to be configured with
4 channel inputs. I have a file at /etc/asound.conf. Do you have any
suggestions on how to configure that?
Thanks a lot for your previous quick reply!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, I forgot to show what command I sent:
./pocketsphinx_continuous -adcdev plughw:0,0 -hmm
~/model/hmm/en_US/hub4wsj_sc_8k -lm ~/model/lm/en/turtle.DMP -dict
~/model/lm/en/turtle.dic
How do I check what the proper device name should be?
When I type arecord -l, here's what I got: * List of CAPTURE Hardware Devices *
card 0: Audio , device 0: CS5535 Audio
Subdevices: 1/1
Subdevice #0: subdevice #0
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Maybe your alsa is not configured correctly or something like that. You can
try arecord first. If it does not work its more a question for alsa
developers, not to us.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can have arecord record. With the -c1 option, the voice changes to a high
pitch voice with quite a lot of noise. With the -c4 option, arecord -D'hw:0,0'
-c4 -r48000 -fS16_LE -d5 test/test.wav, the recording sounds clear. When I try
to run pocketsphinx, it complains about not being able to set the device to
mono. Therefore, I'm wondering if there is a way to use a 4 channel input.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please understand the alsa architecture. There are hw inputs which are raw
hardware. They are not configurable and formats are hardcoded. There are
plughw inputs which alsa provides for applications like pocketsphinx. Plughw
allows to read data in arbitrary format with resampling provided by alsa
If you don't have plughw you need to configure it in ALSA configuration.
Otherwise you can just record audio your self, resample and feed into
pocketsphinx. Pocketsphinx doesn't have resampling functionality.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
ERROR: "continuous.c", line 131: Input audio file has [2] channels, expected single channel mono
FATAL: "continuous.c", line 165: Failed to process file 'op1.wav' due to format mismatch.
someone please help me
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have pocketsphinx compiled on a geode i586-linux. When I tried the sample
input files, pocket_continuous runs correctly. However, when I run it using
the microphone input, it doesn't recognize the start of speech and is stuck at
the Ready state. I suspect that it's because the sampling rate is 48kHz
instead of the required 16kHz and there are 4 channel inputs (when I use
arecord) and I can't switch to mono channel input. I am not sure how I can
resolve the problem of a different sampling rate and 4 channel inputs. Anyone
has any idea?
Thanks!
It doesn't seem that sampling rate matters, you just need to record from a
proper device. You can test with arecord which one works. You can select
devices in pocketsphinx using -adcdev option. If pocketsphinx is compiled with
alsa that would be alsa device name. With pulseaudio it will be pulseaudio
device name. With OSS you need to point a dsp device file.
Hi, I did that. However, it gave me an error: Failed to set PCM device to
mono: Invalid argument
FATAL_ERROR: "continuous.c", line 242: Failed top open audio device
after I tried executing this: ./pocketsphinx_continuous -adcdev hw:0,0 -hmm
~/model/hmm/en_US/hub4wsj_sc_8k -lm ~/model/lm/en/turtle.DMP -dict
~/model/lm/en/turtle.dic
I have no idea how to set alsa device to mono. It seems to be configured with
4 channel inputs. I have a file at /etc/asound.conf. Do you have any
suggestions on how to configure that?
Thanks a lot for your previous quick reply!
Proper device name should be something like plughw:0,0 not hw which is a raw
hardware input.
I tried that, but I got this error:
Failed to set hwparams: Invalid argument
FATAL_ERROR: "continuous.c", line 242: Failed top open audio device
Sorry, I forgot to show what command I sent:
./pocketsphinx_continuous -adcdev plughw:0,0 -hmm
~/model/hmm/en_US/hub4wsj_sc_8k -lm ~/model/lm/en/turtle.DMP -dict
~/model/lm/en/turtle.dic
How do I check what the proper device name should be?
When I type arecord -l, here's what I got:
* List of CAPTURE Hardware Devices *
card 0: Audio , device 0: CS5535 Audio
Subdevices: 1/1
Subdevice #0: subdevice #0
Thanks!
Maybe your alsa is not configured correctly or something like that. You can
try arecord first. If it does not work its more a question for alsa
developers, not to us.
I can have arecord record. With the -c1 option, the voice changes to a high
pitch voice with quite a lot of noise. With the -c4 option, arecord -D'hw:0,0'
-c4 -r48000 -fS16_LE -d5 test/test.wav, the recording sounds clear. When I try
to run pocketsphinx, it complains about not being able to set the device to
mono. Therefore, I'm wondering if there is a way to use a 4 channel input.
Please understand the alsa architecture. There are hw inputs which are raw
hardware. They are not configurable and formats are hardcoded. There are
plughw inputs which alsa provides for applications like pocketsphinx. Plughw
allows to read data in arbitrary format with resampling provided by alsa
If you don't have plughw you need to configure it in ALSA configuration.
Otherwise you can just record audio your self, resample and feed into
pocketsphinx. Pocketsphinx doesn't have resampling functionality.
Ok, I did try to configure it reading online tutorials, but it didn't work.
Anyway, thanks a lot for your help!
ERROR: "continuous.c", line 131: Input audio file has [2] channels, expected single channel mono
FATAL: "continuous.c", line 165: Failed to process file 'op1.wav' due to format mismatch.
someone please help me