The recognition works, however I need to change language model.
To use your improved language model with GStreamer, you just have to set the lm and dict properties on the pocketsphinx element. So, if your language model is in /home/user/mylanguagemodel.lm and the associated dictionary is /home/user/mylanguagemodel.dic, you would add these lines to the init_gst method.
Nothing happens -- I would expect my pocketsphinx to fall, however when it prints "current configuration" in stderr it's still the same one and the recognition works about the same.
Sorry, it still doens't seem to be working for me. I've installed and re-installed everything from recursive github clone of pocketsphinx-python, but it ignores my changes
Had to copy libgstpocketsphinx.so
to /usr/lib/x86_64-linux-gnu/gstreamer-1.0/ manually. Not sure how it got there in a first place, perhaps from apt-get install of gstreamer
Now it lags and does nothing, but at least it seem to respect my changes to config :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I found the solution.
Maybe it sounds obvious, but there is two problems.
The main problem that old pocketsphinx does not support acoustic model changing.
The second problem - new pocketsphinx works with GStreamer version 1.0
Hence, we should obtain both new pocketsphinx and GStreamer and compile them according to tutorial (be especially careful with fullfilling requirements to this command: gst-inspect-1.0 pocketsphinx)
Last edit: Vadim R 2016-10-19
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have everal questions to ask:
Q1: Where should I put my chinese.lm file? The official website says every language has its own directory under /speech_recognition/pocketsphin-data/, but I don’t have this directory; for example, for the default English, the lm.bin file is at pocketsphinx/model/en-us/en-us.lm.bin, where pocketsphin/ is where I ran the make install command.
Should I mkdir /speech_recognition/pocketsphin-data/zh-cn?
Q2: Is dictionary file necessary or I can just only use .lm file for the gstreamer to work?
Q3: Which should I use, the .lm file or .lm.bin file in the gstreamer integration?
Thank you!
Last edit: Cindy Chang 2019-02-03
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am trying to adapt gstreamer tutorial http://cmusphinx.sourceforge.net/wiki/gstreamer (the link to final code is broken, which is ok because there is full listing after the article)
The recognition works, however I need to change language model.
However when I add lines
Nothing happens -- I would expect my pocketsphinx to fall, however when it prints "current configuration" in stderr it's still the same one and the recognition works about the same.
Here is the output of gst-detect-1.0 pocketsphinx: http://pastebin.com/Y9P1fdGy.
Thanks!
Hello
Thank you for your notes, I have updated the manual
I have updated that part too, now it properly refers on how to set properties, please consider:
http://cmusphinx.sourceforge.net/wiki/gstreamer?&#configuring_the_decoder_and_improving_accuracy
Please note that properties are not applied until pipeline is started, you need to start the pipeline in order to see the effect of configuration.
Please also make sure you are using latest pocketsphinx.
Thanks for response!
Sorry, it still doens't seem to be working for me. I've installed and re-installed everything from recursive github clone of pocketsphinx-python, but it ignores my changes
http://pastebin.com/UDPYwcNc I tried to run in on https://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/Russian/ but it still produces english output.
Could you please try it and say if the issue with code or with my setup?
Last edit: Name 2016-05-15
You are using outdated pocketsphinx. You need to clone latest pocketsphinx from http://github.com/cmusphinx/pocketsphinx
Last edit: Nickolay V. Shmyrev 2016-05-16
Thanks.
Had to copy libgstpocketsphinx.so
to /usr/lib/x86_64-linux-gnu/gstreamer-1.0/ manually. Not sure how it got there in a first place, perhaps from apt-get install of gstreamer
Now it lags and does nothing, but at least it seem to respect my changes to config :)
Have you finally solved this issue? If yes, can I ask you to provide solution?
Thanks!
I found the solution.
Maybe it sounds obvious, but there is two problems.
The main problem that old pocketsphinx does not support acoustic model changing.
The second problem - new pocketsphinx works with GStreamer version 1.0
Hence, we should obtain both new pocketsphinx and GStreamer and compile them according to tutorial (be especially careful with fullfilling requirements to this command: gst-inspect-1.0 pocketsphinx)
Last edit: Vadim R 2016-10-19
I have everal questions to ask:
Q1: Where should I put my chinese.lm file? The official website says every language has its own directory under /speech_recognition/pocketsphin-data/, but I don’t have this directory; for example, for the default English, the lm.bin file is at pocketsphinx/model/en-us/en-us.lm.bin, where pocketsphin/ is where I ran the make install command.
Should I mkdir /speech_recognition/pocketsphin-data/zh-cn?
Q2: Is dictionary file necessary or I can just only use .lm file for the gstreamer to work?
Q3: Which should I use, the .lm file or .lm.bin file in the gstreamer integration?
Thank you!
Last edit: Cindy Chang 2019-02-03