Code Monkey home page Code Monkey logo

Comments (22)

syl22-00 avatar syl22-00 commented on September 13, 2024

I do not have a Windows machine to try out so it is hard for me to guess what is going wrong. EMSCRIPTEN is set to 1, right, not false?
You did run make after cmake, right? A few people seem to have succeded, such as here: #6

from pocketsphinx.js.

 avatar commented on September 13, 2024

Thanks. I got success in building pocketsphinx.js, but I get this error in Google Chrome:
debug

from pocketsphinx.js.

syl22-00 avatar syl22-00 commented on September 13, 2024

I guess that means the generated JS file is not valid, does it look like a real JavaScript file?

from pocketsphinx.js.

 avatar commented on September 13, 2024

Yes, but this doesn't include hmm, .dmp or .dic. I am using template.html of pocketsphinx.js-lib. Is it possible to use this just loading hmm, dictionary, language model without grammars (remove feedWord and feedGrammar), as speech-to-text?

from pocketsphinx.js.

syl22-00 avatar syl22-00 commented on September 13, 2024

To load the other JS files, such as HMM or dictionary, you can use the load command in recognizer.js:
https://github.com/syl22-00/pocketsphinx.js#h-loading-files-such-as-acoustic-models-packaged-outside-pocketsphinxjs

And, as you said, if you use a statistical language model and a dictionary file, you should not call feedWords or feedGrammar)

from pocketsphinx.js.

 avatar commented on September 13, 2024

Can I load hmm, .dic and .dmp external files (no *.js, but files in source extension)?

Like this:

...
    var initRecognizer = function () {
        var data = [["-hmm", "pocketsphinx/en-us/hmm/"]];
        data.push(["-dict", "pocketsphinx/en-us/lm/cmusphinx.dic"]);
        data.push(["-lm", "pocketsphinx/en-us/lm/cmusphinx.dmp"]);
        postRecognizerJob({
            command: "initialize",
            data: data
        },
            function () {
                if (recorder) recorder.consumers = [recognizer];
                else recognizerReady();
        });
    };
...

If so, why do I get this error?

INFO: C:\Users\Danilo\Desktop\Arquivos\pocketsphinx.js\sphinxbase\src\libsphinxbase\util\cmd_ln.c(697): Parsing command line:
pocketsphinx.js:1 \
pocketsphinx.js:1   -bestpath no \
pocketsphinx.js:1   -dict pocketsphinx/en-us/lm/cmusphinx.dic \
pocketsphinx.js:1   -hmm pocketsphinx/en-us/hmm/ \
pocketsphinx.js:1   -lm pocketsphinx/en-us/lm/cmusphinx.dmp \
pocketsphinx.js:1   -remove_noise no 
pocketsphinx.js:1 
pocketsphinx.js:1 Current configuration:
pocketsphinx.js:1 [NAME]        [DEFLT]     [VALUE]
pocketsphinx.js:1 -adcdev               
pocketsphinx.js:1 -agc      none        none
pocketsphinx.js:1 -agcthresh    2.0     2.000000e+00
pocketsphinx.js:1 -allphone         
pocketsphinx.js:1 -allphone_ci  no      no
pocketsphinx.js:1 -alpha        0.97        9.700000e-01
pocketsphinx.js:1 -argfile          
pocketsphinx.js:1 -ascale       20.0        2.000000e+01
pocketsphinx.js:1 -aw       1       1
pocketsphinx.js:1 -backtrace    no      no
pocketsphinx.js:1 -beam     1e-48       1.000000e-48
pocketsphinx.js:1 -bestpath yes     no
pocketsphinx.js:1 -bestpathlw   9.5     9.500000e+00
pocketsphinx.js:1 -bghist       no      no
pocketsphinx.js:1 -ceplen       13      13
pocketsphinx.js:1 -cmn      current     current
pocketsphinx.js:1 -cmninit  8.0     8.0
pocketsphinx.js:1 -compallsen   no      no
pocketsphinx.js:1 -debug                0
pocketsphinx.js:1 -dict             pocketsphinx/en-us/lm/cmusphinx.dic
pocketsphinx.js:1 -dictcase no      no
pocketsphinx.js:1 -dither       no      no
pocketsphinx.js:1 -doublebw no      no
pocketsphinx.js:1 -ds       1       1
pocketsphinx.js:1 -fdict                
pocketsphinx.js:1 -feat     1s_c_d_dd   1s_c_d_dd
pocketsphinx.js:1 -featparams           
pocketsphinx.js:1 -fillprob 1e-8        1.000000e-08
pocketsphinx.js:1 -frate        100     100
pocketsphinx.js:1 -fsg              
pocketsphinx.js:1 -fsgusealtpron    yes     yes
pocketsphinx.js:1 -fsgusefiller yes     yes
pocketsphinx.js:1 -fwdflat  yes     yes
pocketsphinx.js:1 -fwdflatbeam  1e-64       1.000000e-64
pocketsphinx.js:1 -fwdflatefwid 4       4
pocketsphinx.js:1 -fwdflatlw    8.5     8.500000e+00
pocketsphinx.js:1 -fwdflatsfwin 25      25
pocketsphinx.js:1 -fwdflatwbeam 7e-29       7.000000e-29
pocketsphinx.js:1 -fwdtree  yes     yes
pocketsphinx.js:1 -hmm              pocketsphinx/en-us/hmm/
pocketsphinx.js:1 -infile               
pocketsphinx.js:1 -input_endian little      little
pocketsphinx.js:1 -jsgf             
pocketsphinx.js:1 -kdmaxbbi -1      -1
pocketsphinx.js:1 -kdmaxdepth   0       0
pocketsphinx.js:1 -kdtree               
pocketsphinx.js:1 -keyphrase            
pocketsphinx.js:1 -kws              
pocketsphinx.js:1 -kws_plp  1e-1        1.000000e-01
pocketsphinx.js:1 -kws_threshold    1       1.000000e+00
pocketsphinx.js:1 -latsize  5000        5000
pocketsphinx.js:1 -lda              
pocketsphinx.js:1 -ldadim       0       0
pocketsphinx.js:1 -lextreedump  0       0
pocketsphinx.js:1 -lifter       0       0
pocketsphinx.js:1 -lm               pocketsphinx/en-us/lm/cmusphinx.dmp
pocketsphinx.js:1 -lmctl                
pocketsphinx.js:1 -lmname               
pocketsphinx.js:1 -logbase  1.0001      1.000100e+00
pocketsphinx.js:1 -logfn                
pocketsphinx.js:1 -logspec  no      no
pocketsphinx.js:1 -lowerf       133.33334   1.333333e+02
pocketsphinx.js:1 -lpbeam       1e-40       1.000000e-40
pocketsphinx.js:1 -lponlybeam   7e-29       7.000000e-29
pocketsphinx.js:1 -lw       6.5     6.500000e+00
pocketsphinx.js:1 -maxhmmpf 10000       10000
pocketsphinx.js:1 -maxnewoov    20      20
pocketsphinx.js:1 -maxwpf       -1      -1
pocketsphinx.js:1 -mdef             
pocketsphinx.js:1 -mean             
pocketsphinx.js:1 -mfclogdir            
pocketsphinx.js:1 -min_endfr    0       0
pocketsphinx.js:1 -mixw             
pocketsphinx.js:1 -mixwfloor    0.0000001   1.000000e-07
pocketsphinx.js:1 -mllr             
pocketsphinx.js:1 -mmap     yes     yes
pocketsphinx.js:1 -ncep     13      13
pocketsphinx.js:1 -nfft     512     512
pocketsphinx.js:1 -nfilt        40      40
pocketsphinx.js:1 -nwpen        1.0     1.000000e+00
pocketsphinx.js:1 -pbeam        1e-48       1.000000e-48
pocketsphinx.js:1 -pip      1.0     1.000000e+00
pocketsphinx.js:1 -pl_beam  1e-10       1.000000e-10
pocketsphinx.js:1 -pl_pbeam 1e-5        1.000000e-05
pocketsphinx.js:1 -pl_window    0       0
pocketsphinx.js:1 -rawlogdir            
pocketsphinx.js:1 -remove_dc    no      no
pocketsphinx.js:1 -remove_noise yes     no
pocketsphinx.js:1 -remove_silence   yes     yes
pocketsphinx.js:1 -round_filters    yes     yes
pocketsphinx.js:1 -samprate 16000       1.600000e+04
pocketsphinx.js:1 -seed     -1      -1
pocketsphinx.js:1 -sendump          
pocketsphinx.js:1 -senlogdir            
pocketsphinx.js:1 -senmgau          
pocketsphinx.js:1 -silprob  0.005       5.000000e-03
pocketsphinx.js:1 -smoothspec   no      no
pocketsphinx.js:1 -svspec               
pocketsphinx.js:1 -time     no      no
pocketsphinx.js:1 -tmat             
pocketsphinx.js:1 -tmatfloor    0.0001      1.000000e-04
pocketsphinx.js:1 -topn     4       4
pocketsphinx.js:1 -topn_beam    0       0
pocketsphinx.js:1 -toprule          
pocketsphinx.js:1 -transform    legacy      legacy
pocketsphinx.js:1 -unit_area    yes     yes
pocketsphinx.js:1 -upperf       6855.4976   6.855498e+03
pocketsphinx.js:1 -usewdphones  no      no
pocketsphinx.js:1 -uw       1.0     1.000000e+00
pocketsphinx.js:1 -vad_postspeech   50      50
pocketsphinx.js:1 -vad_prespeech    10      10
pocketsphinx.js:1 -vad_threshold    2.0     2.000000e+00
pocketsphinx.js:1 -var              
pocketsphinx.js:1 -varfloor 0.0001      1.000000e-04
pocketsphinx.js:1 -varnorm  no      no
pocketsphinx.js:1 -verbose  no      no
pocketsphinx.js:1 -warp_params          
pocketsphinx.js:1 -warp_type    inverse_linear  inverse_linear
pocketsphinx.js:1 -wbeam        7e-29       7.000000e-29
pocketsphinx.js:1 -wip      0.65        6.500000e-01
pocketsphinx.js:1 -wlen     0.025625    2.562500e-02
pocketsphinx.js:1 
pocketsphinx.js:1 INFO: C:\Users\Danilo\Desktop\Arquivos\pocketsphinx.js\sphinxbase\src\libsphinxbase\feat\feat.c(715): Initializing feature stream to type: '1s_c_d_dd', ceplen=13, CMN='current', VARNORM='no', AGC='none'
pocketsphinx.js:1 INFO: C:\Users\Danilo\Desktop\Arquivos\pocketsphinx.js\sphinxbase\src\libsphinxbase\feat\cmn.c(143): mean[0]= 12.00, mean[1..12]= 0.0
pocketsphinx.js:1 ERROR: "C:\Users\Danilo\Desktop\Arquivos\pocketsphinx.js\pocketsphinx\src\libpocketsphinx\acmod.c", line 90: Folder 'pocketsphinx/en-us/hmm/' does not contain acoustic model definition 'mdef'

from pocketsphinx.js.

syl22-00 avatar syl22-00 commented on September 13, 2024

So you have to load these files before you initialize the recognizer with the command line arguments you provided. So make sure:

  • The files are loaded through the load command to the worker(mdef.js and so on)
  • if yes, look inside these javascript files to make sure their paths are what you use (in your case it should be pocketsphinx/en-us/hmm/mdef, and so on

from pocketsphinx.js.

syl22-00 avatar syl22-00 commented on September 13, 2024

To be more specific, look at the first lines, you shoule have something like

Module['FS_createPath']('/folder', 'file', true, true);

from pocketsphinx.js.

 avatar commented on September 13, 2024

Thank you for help and support. It's working for me. Thank you really.

from pocketsphinx.js.

shanter93 avatar shanter93 commented on September 13, 2024

When i'm trying to compile pocketsphinx with cmake gui an error occurs which says
"CMake Error: CMake can not determine linker language for target: pocketsphinx"
Please help.
Thanks in advance.

from pocketsphinx.js.

syl22-00 avatar syl22-00 commented on September 13, 2024

Please provide more information wit the steps you took up to that point. My best guess is that the path to emscripten toolchain was not correctly set.

from pocketsphinx.js.

shanter93 avatar shanter93 commented on September 13, 2024

Steps i followed.
Im using windows 7 64 bit
1.I have downloaded pocketsphinx zip file from https://github.com/syl22-00/pocketsphinx.js and extracted it to a local drive.
2.I have created a build folder inside the base directory
3.Now i opened my cmake gui and specified the target and build directories.
(i have my empscripten and MINGW32 already installed).
4.Now i clicked on configure and selected the MINGW makefiles as generator and specified the path for empscripten.cmake(tool for cross-compiling)
5.When i clicked on generate button the following error occurs
"CMake Error at CMakeLists.txt:83 (add_library):
Cannot find source file:

D:/Work/syl22-00-pocketsphinx.js-7a6a61f/pocketsphinx/src/libpocketsphinx/acmod.c

Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx

CMake Error: CMake can not determine linker language for target: pocketsphinx
CMake Error: Cannot determine link language for target "pocketsphinx".
Generating done

from pocketsphinx.js.

syl22-00 avatar syl22-00 commented on September 13, 2024

It seems like you do not have pocketsphinx (and probably sphinxbase) code. It is typically added via submodules as explained in the docs. If you do not want to clone pocketsphinx.js repository, you'll have to add the pocketsphinx and sphinxbase folders manually.

from pocketsphinx.js.

shanter93 avatar shanter93 commented on September 13, 2024

Can you give a brief tutorial on how to add those folders..?

But previously i have also executed the following commands before doing all the above mentioned steps.

git submodule init
git submodue update

but nothing happend for this code..

from pocketsphinx.js.

ddugovic avatar ddugovic commented on September 13, 2024

I assume the .zip file doesn't contain a .git directory. Try the following:
git add origin https://github.com/syl22-00/pocketsphinx.js.git && git pull

from pocketsphinx.js.

syl22-00 avatar syl22-00 commented on September 13, 2024

Since the archive does not include the .git folder, you can't add an origin to it.

So you have two choices:

  • Clone the repo (preferred, just like what the doc says):
    • git clone [email protected]:syl22-00/pocketsphinx.js.git
    • cd pocketsphinx.js
    • git submodule init
    • git submodue update
  • Download the archive of pocketsphinx.js (very much not recommended)
    • Put the pocketsphinx and sphinxbase folders into it (you can get those from the upstream repo )
    • cross fingers for the versions to be in sync (which the submodules way guaranties, that's why it is recommended)

from pocketsphinx.js.

shanter93 avatar shanter93 commented on September 13, 2024

Thank you so much .
It was really helpful. This solved the issue.

from pocketsphinx.js.

vigneshkumar17 avatar vigneshkumar17 commented on September 13, 2024

hi @syl22-00 ,
I tried to your demo, its helpful.
But i'm trying to use my Dictionary and language model, instead of gram file in live.html.

Actually i downloaded the sub-modules "Pocketsphix" and "sphinxbase" and compiled it.
Using "pocketsphinx_continuous.exe" i tried live speech with my dict and lm, its working fine in command promt.

Now my question is how can i make it work in "Pocketsphinx.js", (ie, without using gram file in live.html, i want to use my dict and lm).

So can you help me with this problem.
Thanks in advance.

from pocketsphinx.js.

syl22-00 avatar syl22-00 commented on September 13, 2024

It is quite straightforward, you lazy-load your model and dictionary files and then initialize the recognizer with the -lm, -dict, or -hmm parameters as you'd do in the command line. All is explained in the README file.

from pocketsphinx.js.

vigneshkumar17 avatar vigneshkumar17 commented on September 13, 2024

Thanks for the help @syl22-00 , i will try this lazy-load solution.

from pocketsphinx.js.

vigneshkumar17 avatar vigneshkumar17 commented on September 13, 2024

Hi @syl22-00

i tried the lazy load as you told, but i'm not sure how to use it in your live.html, i tried it, but i couldn't achieve my goal.
So can you help by guiding me in step by step process,how to use lazyload to load my dict,lm without the grammar words.
it will be so helpful for me.

Thanks in advance.

from pocketsphinx.js.

1Caxz avatar 1Caxz commented on September 13, 2024

I got this error when compiling using the new version emscripten and CMake. It's like embed not working because set argument. any solution?
Screen Shot 2022-04-13 at 11 33 45

from pocketsphinx.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.