Open jjenzz opened 6 years ago
I believe that means pocketsphinx.wasm was not found. You can set the location in your postMessage call: this.recognizer.postMessage({'pocketsphinx.wasm': 'path/to/pocketsphinx.wasm'});
.
@syl22-00 I'm not sure that is the issue because the following suggests it found something in the wasm
file that it wasn't expecting:
expected magic word 00 61 73 6d, found 3c 21 44 4f @+0
Furthermore:
This is indeed strange, is it a file that you compiled yourself? It does not have the correct header and is only 1.2KB big. The file in the repo is 467kB big.
Got this same error for the opus-media-recorder library. (this is the only result on the internet for the given "expected magic word..." error message!)
For me, the problem was that I was using the following:
app.use(require("connect-history-api-fallback")({
rewrites: [
{
from: /^(.(?!\.(html|js|css|png|jpg)))+$/, // paths with these extensions will NOT be redirected to "index.html""
to(context) {
return "/index.html";
},
},
],
}));
Notice that it's rewriting any url's that don't end in the special resource-extensions (html, js, etc.) with the url for the homepage. The problem is that I forgot to add .wasm
to that list, meaning that when the browser requested the .wasm
files, it was receiving the index.html
file instead.
Adding .wasm
to that list resolved the issue.
3c 21 44 4f @+0
in ascii is <!DO
whihc is the header of a HTML file. So the file you're trying to load is not found in the path given. You'll have to statically deploy the relevant files first in order for the HTTP request to be made.
I am trying to get this up and running and I'm getting the following error:
The only code I have atm is:
All files from the
webapp/js
directory are in my publicjs
directory.Any idea where I am going wrong?