Menu

problems with sphinx2-test

Help
2003-01-10
2012-09-22
  • Cyrus Adkisson

    Cyrus Adkisson - 2003-01-10

    The basic problem is that sphinx2-test won't correctly recognize the turtle-language words I speak. I've recorded a sound file with the following command in the turtle directory:

    adrec 16000 6 turnleft.16k

    ... during which I speak the words, "Turn left ninety degrees."

    Playing back with:

    bplay -r -S -b 16 -s 16000 turnleft.16k

    ... the file sounds fine.

    My decibal range is between 22 and 30 most of the time, which should be OK, right? I've changed the turtle.ctl file to read turnleft.16k, but I always get an incorrect translation such as "HALL ARE FOUR." I've tried rerecording my voice on the same phrase various times, but the translation always ends up weird. Some examples are:

    "FOUR ARE FOUR HALL"

    and

    "FOUR ROOM THE ARE"

    I don't see any other types of output errors, just the incorrect translation. I didn't do any training, but I was under the impression that the turtle language should work "out of the box"... is that right?

    Any help would be greatly appreciated.

    (Oh. Linux 2.4.18-14, RedHat 8.0, Pentium 4, badass monitor... what?)

     
    • robert b

      robert b - 2003-01-10

      I have never used bplay, but I assume that

      -r means raw
      -S means single channel (mono)
      -b 16 means 16 bits wide
      -s 16000 means a sampling rate of 16000

      I also assume that, since Sphinx is being run on the same machine it's being recorded on, the endian-ness is the same.

      If all of my assumptions are true, then it should work.

      Have you tried sphinx2-simple ?

       
    • Cyrus Adkisson

      Cyrus Adkisson - 2003-01-12

      I figured out what my problem was, although I don't really understand what was causing it. As I said before, when I listened to the "Turn left ninety degrees" clip with bplay -s 16000 it sounded fine, and since sphinx2 is supposed to default to 16000 when recognizing speech, I didn't think that was the problem.

      But, I listened to the sample that came with the download at 16000 and sure enough, it sounded like the Chipmunks, running at double speed, while my "Turn left ninety degrees" clip sounded normal at 16000 playback. So, I got another recording program (rawrec) and recorded my "Turn left ninety degrees" clip at 8000 instead of 16000 and it worked fine.

      What bothers me about this is why, when I have the -samp flag set to 16000, does sphinx2-test only recognize files recorded at speed 8000 correctly? And why does it start screwing up on files recorded at 8000 when the -samp flag is set to 8000. Does it have something to do with using stereo instead of mono or something?

       
    • Anonymous

      Anonymous - 2003-01-13

      I'm not really familiar with the adrec, bplay, rawrec utilities, but IMO your last sentence points to the explanation.

      The example file goforward.16k is a single channel file sampled at 16 kHz, 16-bit samples.It's about 5.05 sec long.  5.05*16000*2 bytes/sample = 161K samples, which matches that file.  Furthermore, I think that Sphinx (normally expects) a single-channel audio input stream; from my limited familiarity with its front end, I don't see any way to specify a stereo input stream.

      From your account, it appears that adrec recorded a stereo audio file.  (Look at the length of that file and do the math as above to confirm this. 6 seconds * 16000 * 4 bytes per sample = 384K; it it that long?)  Your bplay -S option (stereo) and the fact that you said it sounded right strongly suggest this.

      A stereo audio file contains pairs of samples in succession, i.e.,
        sample 0, chnl 1
        sample 0, chnl 2
        sample 1, chnl 1
        sample 1, chnl 2, and so forth.
      When you listened (in stereo mode) to goforward.16k, each channel got only every other sample, so it sounded as if you were playing it back at double-speed!

      The bottom line is: record your new audio files single-channel, 16000 Hz, 16 bits per sample.

       

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.