mirror of
https://github.com/leon-ai/leon.git
synced 2024-08-17 06:00:33 +03:00
fix: hotword offline (#342)
This commit is contained in:
parent
bd53641a81
commit
f563d01d07
@ -7,7 +7,7 @@
|
||||
|
||||
const request = require('superagent')
|
||||
const record = require('node-record-lpcm16')
|
||||
const { Detector, Models } = require('snowboy')
|
||||
const { Detector, Models } = require('@bugsounet/snowboy')
|
||||
const { io } = require('socket.io-client')
|
||||
|
||||
process.env.LEON_HOST = process.env.LEON_HOST || 'http://localhost'
|
||||
@ -39,7 +39,7 @@ request.get(`${url}/v1/info`)
|
||||
})
|
||||
|
||||
const detector = new Detector({
|
||||
resource: `${__dirname}/node_modules/snowboy/resources/common.res`,
|
||||
resource: `${__dirname}/node_modules/@bugsounet/snowboy/resources/common.res`,
|
||||
models,
|
||||
audioGain: 2.0,
|
||||
applyFrontend: true
|
||||
|
2064
hotword/package-lock.json
generated
2064
hotword/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -14,7 +14,8 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"node-record-lpcm16": "^0.3.0",
|
||||
"snowboy": "git+https://github.com/leon-ai/snowboy.git",
|
||||
"@mapbox/node-pre-gyp": "^1.0.8",
|
||||
"@bugsounet/snowboy": "^2.2.3",
|
||||
"socket.io-client": "^4.0.0",
|
||||
"superagent": "^3.5.2"
|
||||
}
|
||||
|
@ -36,6 +36,8 @@ export default () => new Promise(async (resolve, reject) => {
|
||||
log.info('Installing hotword dependencies...')
|
||||
await command('cd hotword && npm install', { shell: true })
|
||||
log.success('Offline hotword detection installed')
|
||||
await command('cd hotword/node_modules/@bugsounet/snowboy && CXXFLAGS="--std=c++17" ../../../node_modules/@mapbox/node-pre-gyp/bin/node-pre-gyp clean configure build', { shell: true })
|
||||
log.success('Snowboy bindings compiled')
|
||||
|
||||
resolve()
|
||||
} catch (e) {
|
||||
|
Loading…
Reference in New Issue
Block a user