-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
49 lines (39 loc) · 1.25 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
if [ $# -ne 1 ]
then
echo "Usage: `basename $0` <lang>"
exit 1
fi
lang=$1
# HMM_BASE
models=
# HMM_FOLDERS
model=
echo "Building pocketsphinx.js for language $lang"
if [ $lang = "en" ]; then
# The default acoustic models (English) of pocketsphinx.js
models=${POCKETSPHINX_JS}/am
model=rm1_200
# Other possible acoustic models
#model=en-us
#model=en_broadcastnews_16k_ptm256_5000
##model=voxforge_en_sphinx.cd_cont_5000
else
# Estonian acoustic models
models=${POCKETSPHINX_HMM_ET}
# This generates a 14 MB js-file
model=est16k.cd_ptm_1000-mapadapt
# This is used successfully in the Android app Inimesed,
# but it results in a 110 MB js-file
# that took too long to load in the browser.
#model=est16k.cd_cont_3000-mapadapt
fi
# -DLARGE_PHONESET=1
# If your acoustic model has more than 64 phones,
# such as for the Chinese model packaged with PocketSphinx.
# -DALLOW_MEMORY_GROWTH=1
# If you package large files (acoustic model, language model, dictionary),
# you'll probably need to allow the memory to grow beyond the default value.
#
emscripten_cmake=${EMSCRIPTEN}/cmake/Platform/Emscripten.cmake
cmake -DEMSCRIPTEN=1 -DCMAKE_TOOLCHAIN_FILE=${emscripten_cmake} -DHMM_BASE=${models} -DHMM_FOLDERS=${model} -DALLOW_MEMORY_GROWTH=1 ${POCKETSPHINX_JS}
make