Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Speech recognition in JavaScript and WebAssembly
| Date | Stars |
|---|---|
| 2026-07-31 | 1507 |
| 2026-08-06 | 1506 |
Today
-1 stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
PocketSphinx.js
---------------
### Speech Recognition in JavaScript and WebAssembly
PocketSphinx.js is a speech recognizer that runs entirely in the web browser. It is built on:
* a speech recognizer written in C ([PocketSphinx](http://cmusphinx.sourceforge.net/)) converted into JavaScript or [WebAssembly](http://webassembly.org/) using [Emscripten](https://github.com/kripken/emscripten),
* an audio recorder using the web audio API. The audio recorder can be used independently to build other kinds of audio-related web applications. There is a more detailed documentation in `doc/AudioRecorder/README.md`.
You can try it on the project page: <https://syl22-00.github.io/pocketsphinx.js> and have a look at the [FAQ](https://github.com/syl22-00/pocketsphinx.js/wiki/FAQ).
Table of contents:
1. Overview
2. Compilation of `pocketsphinx.js`
3. API of `pocketsphinx.js`
4. Using `pocketsphinx.js` inside a Web Worker with `recognizer.js`
5. Wiring `recognizer.js` to the audio recorder
6. Live demo
7. Test suite
8. Notes about speech recognition and performance
9. License
# 1. Overview
This project includes several components that can be used independently:
* `pocketsphinx.js`, a JavaScript library generated by emscripten which is basically PocketSphinx wrapped to provide a simpler API, and compiled into JavaScript or WebAssembly.
* `pocketsphinx.wasm`, the compiled WebAssembly file (if compiled into WebAssembly).
* `recognizer.js`, a wrapper around `pocketsphinx.js` inside a Web Worker to unload the UI thread from downloading and running the large JavaScript file and running the costly speech recognition process.
* `audioRecorder.js`, an audio recording library, based on [Recorderjs](https://github.com/mattdiamond/Recorderjs). It converts the recorded samples to the proper sample rate and passes them to the recognizer. There is a more detailed documentation in `doc/AudioRecorder/README.md`.
* `callbackManager.js`, a small utility to interact with Web Workers with calls and callbacks rather than message passing.
The file `webapp/live.html` illustrates how these work together in a real application, that is a good starting point. Make sure you load it through a web server or start Chrome with `--disable-web-security`. It is also recommended to serve the `wasm` file with the correct MIME type (`application/wasm`). For instance, you can start a small web server with `./server.py` in the base directory and open `http://localhost:8000/webapp/live.html` in your browser (make sure it is launched with python 2).
Note that the app must be served through https (or localhost, or with `--disable-web-security`) to allow audio recording.
There is also a live demo for Chinese. To try it, open `http://localhost:8000/webapp/live_zh.html` in your browser.
In addition to speech recognition, there is also a keyword spotting functionality that detects a specific word or phrase in the audio input. There are live demos in `webapp/live.html` (via a key phrases file) and `webapp/live_kws.html` (via keyword spotting API).
# 2. Compilation of `pocketsphinx.js`
A prebuilt version of `pocketsphinx.js` is available in `webapp/js`, or you can build it yourself. Below is the procedure on Linux (and Mac OS X). On Windows, refer to the emscripten manual.
The code of upstream `Pocketsphinx` is referenced as git submodules, so before you compile, you must make sure you have retrieved the content of the submodules. You can either clone `pocketsphinx.js` with the `--recursive` option, or run:
```
$ git submodule init
$ git submodule update
```
## 2.a Compilation with the default acoustic model
You will need:
* [emscripten](https://github.com/kripken/emscripten) (which implies also node.js and LLVM-fastcomp compiler, see emscripten docs for instructions on how to get it),
* [CMake](http://www.cmake.org/).
The build is a classic CMake cross-compilation, using the toolchain provided by emscripten:
$ cd .../pocketsphinx.js # This folder
$ mkdir build
Excerpt of 46,261 characters
Read on GitHub214
2
2
1
1
1
1
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:179b7b050042b7c2, desc:speech recognition