Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make pocketsphinx.js core CommonJS compatible #19

Closed
derhuerst opened this issue Jul 26, 2014 · 2 comments
Closed

make pocketsphinx.js core CommonJS compatible #19

derhuerst opened this issue Jul 26, 2014 · 2 comments

Comments

@derhuerst
Copy link

Even though JavaScript in Browsers and node.js have an asynchronous, event-driven architecture, sometimes it may be useful to include the core pocketsphinx.js file directly in node or a browser. Using node, there is currently no way (eval doesn't count) to use the library.

I once wrote a small wrapper for libraries supposed to be used in both browser and node.js environments. Have a look!

Because I'm not familiar with emscripten, I don't know if there's a way to automatically pre- and append code, but that would be nice! Maybe a build system like Grunt would be good here.

If there is no option in emscripten, I could also setup a small build script.

@syl22-00
Copy link
Owner

@derhuerst , thanks a lot for your interest. Unless I misunderstood your issue, it is actually easy to use pocketsphinx.js, or any Emscripten generated-library with node.js, without browser environment. For instance:

var ps = require('./pocketsphinx.js');
var config = new ps.Config();
config.push_back(["-fwdflat", "no"]);
...
config.delete();

@syl22-00
Copy link
Owner

No feedback, so closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants