Open ginixsan opened 5 years ago
Just took a quick look at this, looks like this is a bug that was introduced in the most recent version. I'll take a stab at fixing it this weekend and publishing a fix. Thanks for reporting this!
(node:3503) UnhandledPromiseRejectionWarning: TypeError: record.pause is not a function
at Writable.sonus.pause (/home/ztik/nodejs/sara/node_modules/sonus/index.js:141:12)
Seems like it is still ongoing (for me at least)...
A solution/workaround would be appreciated, but personally I am not in any hurry ;)
Oof, this fell off my radar, sorry! Will attempt to fix asap.
No need to apologize, instead I should say thanks for this wonderful module. It is a core function of my app, without it I'd have no app at all ;) (I also included a link to sonus in the credits of my app)
P.S. feel free to ask for more information if you need any
Immediate solution is to comment out https://github.com/evancohen/sonus/blob/master/index.js#L140-L146 in your node_modules
folder. It seems that at some point pause and resume was removed from the underlying audio library.
They just pushed a new version of that library that supports this functionality, so I'm going to go ahead and update everything to use that instead.
So I have a working version with the new recording library, but it didn't match well with the current implementation. I'm not thrilled with the results. I'm going to do a refactor, but I've pushed the changes as-is to the pause-resume
branch and published a release candidate on npm: sonus@1.0.4-rc1
To use this version just
npm install sonus@next
I have just ran npm uninstall sonus
and npm install sonus@next
.
package.json seems to confirm this:
"dependencies": {
"sonus": "^1.0.4-rc1",
However, I am still receiving the same error as before:
(node:3436) UnhandledPromiseRejectionWarning: TypeError: record.pause is not a function
at Object.Sonus.pause (/home/ztik/nodejs/sara/node_modules/sonus/index.js:204:28)
at Object.pause (/home/ztik/nodejs/sara/hearing.js:63:11)
Is it possible that some dependency requires separate updating? (I'm new to javascript/nodejs, so it is quite possible that I'm wrong/misunderstanding)
edit:
package.json in ./node_modules/sonus also tells me I'm using rc1:
"version": "1.0.4-rc1"
Any update on this?
It seems that the "node-record-lpcm16" version used by Sonus ("^0.3.1") doesn't support Pause/Resume until version "1.0.0". Attempted to rectify the issue by using "npm install sonus@next" but was unsuccessful.
I won't be able to look at this until over the holidays, but hopefully I can figure something out on vacation next week.
I gave it a go and managed to have some success. I tested it on a Raspberry Pi and it seemed to be working.
Hi !
I'm trying to use .pause()
and .resume()
but I got this error: INVALID_INDEX
.
I've created a socket.io mechanism to talk the background sonus process to allow it to reliquish the microphone. also added mechanism to use the existing plugins the get audio back from secondary recording
for alex and google assistant, think of the multi-turn dialog for creating a calendar entry
I've read previous issues but haven't been able to get anything clear.When I try to pause or resume sonus with Sonus.pause(sonus). I get this error.
I've tried too stoping it and restarting it but then I get the
That I saw some people get too. Anybody was able to get any workaround to pause sonus and resume it?