Menu

pocketsphinx sampling rate & channel...

Help
Junyun
2011-09-16
2020-12-08
  • Junyun

    Junyun - 2011-09-16

    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!

     
  • Nickolay V. Shmyrev

    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.

     
  • Junyun

    Junyun - 2011-09-22

    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!

     
  • Nickolay V. Shmyrev

    Proper device name should be something like plughw:0,0 not hw which is a raw
    hardware input.

     
  • Junyun

    Junyun - 2011-09-22

    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

     
  • Junyun

    Junyun - 2011-09-22

    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!

     
  • Nickolay V. Shmyrev

    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.

     
  • Junyun

    Junyun - 2011-09-22

    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.

     
  • Nickolay V. Shmyrev

    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.

     
  • Junyun

    Junyun - 2011-09-23

    Ok, I did try to configure it reading online tutorials, but it didn't work.
    Anyway, thanks a lot for your help!

     
  • chandan mohan

    chandan mohan - 2020-12-08

    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

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.