Open mohamed-bahaa21 opened 1 year ago
Hard to say what is PM2. There is no need to load model several times.
Hard to say what is PM2. There is no need to load model several times.
Just a process manager for node apps, yeah I only load it one time. the result is the same without PM2, randomly exits without any error.
Ok, and what is your code? Were you able to run or code samples?
Ok, and what is your code? Were you able to run or code samples?
https://www.dropbox.com/s/6msf7pst9xunwq0/callbot_demo.rar?dl=0
Same issue here (running on Win10, Node.js v18.12.1, VS 2022), but I can see the exception stack:
...
LOG (VoskAPI:ReadDataFiles():model.cc:303) Loading winfo model/graph/phones/word_boundary.int
node:events:491
throw er; // Unhandled 'error' event
^
Error: spawn sox ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn sox',
path: 'sox',
spawnargs: [
'-b', '16',
'--endian', 'little',
'-c', '1',
'-r', '16000',
'-e', 'signed-integer',
'default', '-p'
]
}
It crashes immediately after printing out this line with "LOG .... \word_boundary.int"
My project dependencies:
"dependencies": {
"mic": "^2.1.2",
"vosk": "^0.3.39"
}
Does our sample code work for you?
@lexasss your error is about missing sox
I just downloaded English model (vosk-model-small-en-us-0.15), extracted it into 'model' folder in my project tree. Indeed, there are no files ending with "sox" in this folder. Did I miss some step?
P.S. My index.js file is basically test_microphone.js file (with the only edit from var vosk = require('..');
to var vosk = require('vosk');
).
@lexasss sox binary is used by node mic module to record audio. You have to install it. Or you can use alternative node microphone module.
command line voice recognition chat bot program depends on packages as:
It crashes randomly while its running without any errors to trace or debug. I used PM2 and the memory usage was ~165MB !!! but couldn't trace anything further. the whole logs I have is: