... | ... | @@ -2,15 +2,33 @@ |
|
|
|
|
|
## Overview
|
|
|
|
|
|
When compiling Kaldi to wasm, the following libraries are
|
|
|
compiled:
|
|
|
1. CLAPACK + CBLAS + BLAS
|
|
|
2. OpenFST
|
|
|
3. Kaldi
|
|
|
The diagram below show how the various components interact with
|
|
|
each other
|
|
|
|
|
|
```mermaid
|
|
|
graph TD
|
|
|
Clapack-wasm --> Kaldi
|
|
|
Kaldi --> GUI
|
|
|
Libsamplerate --> GUI
|
|
|
```
|
|
|
|
|
|
The end program, which runs Kaldi in the browser requires Kaldi
|
|
|
as well as Libsamplerate (located under `audio-resampler/src`),
|
|
|
which performs audio resampling to a format suitable for the
|
|
|
speech recognition system.
|
|
|
|
|
|
Kaldi itself relies on a matrix library, which, in our case,
|
|
|
is `clapack-wasm`.
|
|
|
|
|
|
The script `install.sh` compiles all these components to web
|
|
|
assembly.
|
|
|
|
|
|
When installing Kaldi, extra dependencies will be installed.
|
|
|
At this step, you may be prompted to install some of them
|
|
|
manually. If this is the case, please follow the instructions.
|
|
|
|
|
|
When building OpenFST, you may be prompted to install
|
|
|
other programs for Kaldi. If this is the case, follow
|
|
|
the instructions you are given.
|
|
|
To help in debugging compilation issues, here is a summary of
|
|
|
what each of these block contains.
|
|
|
|
|
|
## Build of the matrix library
|
|
|
|
... | ... | @@ -109,8 +127,8 @@ EMSCRIPTEN_BINDINGS(asr) { |
|
|
|
|
|
### Creating the javascript usable files
|
|
|
|
|
|
Given the byte-code file `kaldi/src/online2bin/dirty-preload`, the
|
|
|
javascript usable files are generated via the compiler `em++` (provided
|
|
|
Given the byte-code file `kaldi/src/online2bin/online2-tcp-nnet3-decode-faster-reorganized`,
|
|
|
the javascript usable files are generated via the compiler `em++` (provided
|
|
|
by emscripten).
|
|
|
|
|
|
`em++` takes the byte-code file **with a `.bc` extension** as well as
|
... | ... | |