Comments (6)
Hi @Jsignr , could you share a little bit more details about what you did? Have model files been pre-loaded successfully? Or maybe you can share your files.
You should not need to give a -tmat
argument if you set -hmm
in your config.
from pocketsphinx.js.
Thanks for you reply.
I would like package model files outside the main JavaScript because I can't embedding french model acoustic (http://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/French%20F0%20Broadcast%20News%20Acoustic%20Model/) into JS file (I get fatal error : CALL_AND_RETRY_2 Allocation failed - process out of memory).
So, I have generated pocketsphinx.js with
cmake -DEMSCRIPTEN=1 -DHMM_EMBED=OFF -DCMAKE_TOOLCHAIN_FILE=path_to_emscripten/cmake/Platform/Emscripten.cmake
and
python .../emscripten/tools/file_packager.py .../pocketsphinx.js/build/pocketsphinx.js --embed ..... for each file on my model folder
My simple JS :
window.onload = function() {
var recognizer = new Worker("js/recognizer.js");
recognizer.onmessage = function(event) {
console.log('Recognizer Ready');
};
var id = 0;
recognizer.postMessage('pocketsphinx.js');
recognizer.postMessage({command: 'load',
callbackId: id,
data: ["model/mdef.js",
"model/variances.js",
"model/means.js",
"model/mixture_weights.js",
"model/noisedict.js",
"model/transition_matrices.js",
]
});
recognizer.postMessage({command: 'initialize',
callbackId: id,
});
};
from pocketsphinx.js.
I was actually trying to do the same yesterday, with that model, and found that variances.js
and means.js
can not be loaded. I suspect these two files, who ended up very large (80+MB) are larger than some limit in the browser.
For you, what probably happens is that it went on trying to initialize the recognizer, and failed finding the files that were not loaded.
I'll dig further and update this thread if I find anything useful.
from pocketsphinx.js.
ok thanks :) I will check if it's possible to increase limit browser or other solutions.
from pocketsphinx.js.
@Jsignr so I think I got a fix:
The issue was with the array created from the binary file which requires a gigantic JavaScript line to be created, over the limit.
By adjusting the packaging script, that array can be created by concatenating smaller chunks, and finally the virtual file can be created successfully.
You can find the generated model there:
https://github.com/syl22-00/pocketsphinx.js-fr_FR-lium_french_f0
Note that you will need to set TOTAL_MEMORY
to something larger. I just set it to 100MB.
And if you want to package it yourself, the modified version of file_packager.py
is there:
https://github.com/syl22-00/emscripten/blob/master/tools/file_packager.py
I will then clean it up and make a full request to upstream Emscripten.
Would be great if you could update this ticket, whether you can use it successfully or not.
from pocketsphinx.js.
It works ! Thanks a lot for your help ! :-)
from pocketsphinx.js.
Related Issues (20)
- lazyLoading, Module.FS_createPath not found (emscripten compilation without accoustic model) HOT 1
- some time when click on start i am getting Cannot change search while decoding, end utterance first HOT 1
- FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory HOT 2
- Words.push_back accept 1 arguments only HOT 1
- Trying to build but submodules fail HOT 2
- BindingError with self-compiled pocketsphinx.js HOT 2
- Change threshold to increase accuracy detection HOT 2
- in web form asp.net? HOT 2
- Can't install with npm HOT 1
- Webapp.js file is missing HOT 1
- Buffer in recognizer uses obsolete data on multiple "process"-requests
- issue with make
- Web Worker Lazy Load Command - Outgoing Message is Empty HOT 1
- Compilation Failed In Custom Acoustic Model
- Grammar for numbers? HOT 5
- Pocketsphinx within web worker
- live.html demo no longer works in Chrome, only Firefox
- Compilation into WebAssembly fails HOT 1
- Sorry if I laugh HOT 1
- Local host not working with chrome
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pocketsphinx.js.