mirror of
https://github.com/leon-ai/leon.git
synced 2024-09-11 18:27:21 +03:00
fix: hotword offline (#342)
This commit is contained in:
parent
bd53641a81
commit
f563d01d07
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
const request = require('superagent')
|
const request = require('superagent')
|
||||||
const record = require('node-record-lpcm16')
|
const record = require('node-record-lpcm16')
|
||||||
const { Detector, Models } = require('snowboy')
|
const { Detector, Models } = require('@bugsounet/snowboy')
|
||||||
const { io } = require('socket.io-client')
|
const { io } = require('socket.io-client')
|
||||||
|
|
||||||
process.env.LEON_HOST = process.env.LEON_HOST || 'http://localhost'
|
process.env.LEON_HOST = process.env.LEON_HOST || 'http://localhost'
|
||||||
@ -39,7 +39,7 @@ request.get(`${url}/v1/info`)
|
|||||||
})
|
})
|
||||||
|
|
||||||
const detector = new Detector({
|
const detector = new Detector({
|
||||||
resource: `${__dirname}/node_modules/snowboy/resources/common.res`,
|
resource: `${__dirname}/node_modules/@bugsounet/snowboy/resources/common.res`,
|
||||||
models,
|
models,
|
||||||
audioGain: 2.0,
|
audioGain: 2.0,
|
||||||
applyFrontend: true
|
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",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"node-record-lpcm16": "^0.3.0",
|
"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",
|
"socket.io-client": "^4.0.0",
|
||||||
"superagent": "^3.5.2"
|
"superagent": "^3.5.2"
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,8 @@ export default () => new Promise(async (resolve, reject) => {
|
|||||||
log.info('Installing hotword dependencies...')
|
log.info('Installing hotword dependencies...')
|
||||||
await command('cd hotword && npm install', { shell: true })
|
await command('cd hotword && npm install', { shell: true })
|
||||||
log.success('Offline hotword detection installed')
|
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()
|
resolve()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user