From fddb864dd87c75777c49d0ad1a0baa843adb63e7 Mon Sep 17 00:00:00 2001 From: andy5995 Date: Thu, 30 Aug 2018 21:36:15 -0500 Subject: [PATCH 1/2] package.json:change sphinxbase install location and specify library location (fixes #2) --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 40bcea1..4a30378 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "install": "npm run install:sphinxbase && npm run install:pocketsphinx", "install:sphinxbase": "napa cmusphinx/sphinxbase && npm run build:sphinxbase", "install:pocketsphinx": "napa cmusphinx/pocketsphinx && npm run build:pocketsphinx", - "build:sphinxbase": "cd ./node_modules/sphinxbase && ./autogen.sh && ./configure --prefix=`pwd` && make && make install && cd ../..", - "build:pocketsphinx": "cd ./node_modules/pocketsphinx && ./autogen.sh && ./configure --prefix=`pwd` && make && make install && cd ../..", + "build:sphinxbase": "cd ./node_modules/sphinxbase && ./autogen.sh && ./configure --libdir=$PWD/local/lib --prefix=$PWD/local && make install && cd ../..", + "build:pocketsphinx": "cd ./node_modules/pocketsphinx && ./autogen.sh && LDFLAGS=-Wl,-L$PWD/../sphinxbase/local/lib,-L$PWD/src/libpocketsphinx ./configure --prefix=`pwd` && make && make install && cd ../..", "config:convert": "node ./lib/convert-commands.js" }, "keywords": [ From 758b9e2d1cd3cf08cbbb5f1d021c9ad0bab93bac Mon Sep 17 00:00:00 2001 From: andy5995 Date: Thu, 30 Aug 2018 21:53:20 -0500 Subject: [PATCH 2/2] change bin location of pocketsphinx After I made the change to package.json for this commit, I still got an error when I ran `npm install`. I had to run `make clean` in `node_modules/pocketsphinx/`. Then I ran `npm install` again and it worked. --- lib/pocketsphinx.js | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pocketsphinx.js b/lib/pocketsphinx.js index 6da6bbd..75c79b2 100644 --- a/lib/pocketsphinx.js +++ b/lib/pocketsphinx.js @@ -21,7 +21,7 @@ if (!fs.existsSync('./resources/output.raw')) { } // run process for pocketsphinx_continuous -const command = `./node_modules/pocketsphinx/bin/pocketsphinx_continuous -infile ./resources/output.raw -lm ./resources/corpus/${prefix}.lm -dict ./resources/corpus/${prefix}.dic`; +const command = `./node_modules/pocketsphinx/local/bin/pocketsphinx_continuous -infile ./resources/output.raw -lm ./resources/corpus/${prefix}.lm -dict ./resources/corpus/${prefix}.dic`; exec(command, (error, stdout, stderr) => { if (error) { throw error; diff --git a/package.json b/package.json index 4a30378..e73d2f4 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "install": "npm run install:sphinxbase && npm run install:pocketsphinx", "install:sphinxbase": "napa cmusphinx/sphinxbase && npm run build:sphinxbase", "install:pocketsphinx": "napa cmusphinx/pocketsphinx && npm run build:pocketsphinx", - "build:sphinxbase": "cd ./node_modules/sphinxbase && ./autogen.sh && ./configure --libdir=$PWD/local/lib --prefix=$PWD/local && make install && cd ../..", - "build:pocketsphinx": "cd ./node_modules/pocketsphinx && ./autogen.sh && LDFLAGS=-Wl,-L$PWD/../sphinxbase/local/lib,-L$PWD/src/libpocketsphinx ./configure --prefix=`pwd` && make && make install && cd ../..", + "build:sphinxbase": "cd ./node_modules/sphinxbase && ./autogen.sh && ./configure --prefix=$PWD/local --libdir=$PWD/local/lib && make install && cd ../..", + "build:pocketsphinx": "cd ./node_modules/pocketsphinx && ./autogen.sh && LDFLAGS=-Wl,-L../sphinxbase/local/lib,-L./local/lib ./configure --prefix=$PWD/local --libdir=$PWD/local/lib && make && make install && cd ../..", "config:convert": "node ./lib/convert-commands.js" }, "keywords": [