I please need your kind assistance, I am writing a simple C code program to detect digits from 0 to 9 in a small raw file that should contain just one digit. If the one word file says "five" I want it to reply to me with a successful search for a "five".... that way I can use a switch statement that would look like this:
I've been having a very hard time getting it to work, no matter how much I've google and read the docs. I am using the latest pocketsphinx code as downloaded from github. I believe the first of several problems is my ignorance on the file formats I have to use. I've tried all the code samples and all the language models but the first thing I want to make sure I have right is the file format. Cause I am using a wave file with 8000 sampling rate that says "five" and it is just not recognizing it.
I am also not sure if the name of the function is ps_process_raw(), doesn't it means it process a raw format file?, meaning it will never work if the input file is wav, right? Then how come it works when I use a longer wav file?
Then I found some of the sample code, I've studied test_set_search.c test_ps.c, etc and I have settled on file test_jsgf.c because it uses a gramma file. I proceeded to created a grammar file numbers1.gram with contents like this:
...since I am not successful when using a wav file of my own, I decided to test with a file from the test samples. I found a file named pocketsphinx/test/data/numbers.raw which I assumed to contain digits from zero to nine. I say assume because being a raw format file there is no header therefore no way to export it to anything I can play. I tried to export it to wav but could never guess the right configuration. My goal is to use a file I could name "five.wav" or "five.raw" containing the word "five" and to use code that searches for the word "five". It seems because the file is so short (tops one second) it is difficult to find a threshold, but then I just don't know how to create a file with a format pocketsphinx can search successfully. Could anyone please just show me how to create a wav and a raw file with the parameters pocketsphinx expect for success? kws I understand is for phrase, I don't want to search for a phrase, I want to search for a word.
Allow me to ask the same question from another angle: If I take the "hello world" example and I run it with a file containing a long sentence, about 12 seconds, it recognizes the speech impressively accurately. Then how come whe I use a very short file with one word, for example "five", how come it doesn't recognize it? Thanks.
Last edit: Chris 2020-10-28
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I please need your kind assistance, I am writing a simple C code program to detect digits from 0 to 9 in a small raw file that should contain just one digit. If the one word file says "five" I want it to reply to me with a successful search for a "five".... that way I can use a switch statement that would look like this:
I've been having a very hard time getting it to work, no matter how much I've google and read the docs. I am using the latest pocketsphinx code as downloaded from github. I believe the first of several problems is my ignorance on the file formats I have to use. I've tried all the code samples and all the language models but the first thing I want to make sure I have right is the file format. Cause I am using a wave file with 8000 sampling rate that says "five" and it is just not recognizing it.
I am also not sure if the name of the function is ps_process_raw(), doesn't it means it process a raw format file?, meaning it will never work if the input file is wav, right? Then how come it works when I use a longer wav file?
Then I found some of the sample code, I've studied test_set_search.c test_ps.c, etc and I have settled on file test_jsgf.c because it uses a gramma file. I proceeded to created a grammar file numbers1.gram with contents like this:
...since I am not successful when using a wav file of my own, I decided to test with a file from the test samples. I found a file named pocketsphinx/test/data/numbers.raw which I assumed to contain digits from zero to nine. I say assume because being a raw format file there is no header therefore no way to export it to anything I can play. I tried to export it to wav but could never guess the right configuration. My goal is to use a file I could name "five.wav" or "five.raw" containing the word "five" and to use code that searches for the word "five". It seems because the file is so short (tops one second) it is difficult to find a threshold, but then I just don't know how to create a file with a format pocketsphinx can search successfully. Could anyone please just show me how to create a wav and a raw file with the parameters pocketsphinx expect for success? kws I understand is for phrase, I don't want to search for a phrase, I want to search for a word.
Thank you very much.
My code is this:
```
int main(int argc, char * argv[]) {
}
```
Allow me to ask the same question from another angle: If I take the "hello world" example and I run it with a file containing a long sentence, about 12 seconds, it recognizes the speech impressively accurately. Then how come whe I use a very short file with one word, for example "five", how come it doesn't recognize it? Thanks.
Last edit: Chris 2020-10-28