Closed juggledad closed 5 years ago
Well I forked the code and put in the changes but it looks like this doesn't work. The node.status is fired before the sound finish's playing...sigh...
It would be nice if there was a way to find our when the sound finished playing
Yes you are right - I use a fork system call to run aplayer from the system. So the code has to reworked to wait for the process feedback - when ended. Also it was not designed to interrupt the player with a new payload .. Therefore a rework of the whole model is needed. A possiblility is using a sound-library from nodejs - but i had troubles with it (quality) ..
I have now implemented a version where the msg.payload is send when the play of the sound ends.
It would be nice to return a node.status when finished playing so users could use the status node to continue processing after waiting for the audio to complete.
This could be done simply by adding:
node.status({text:"done"});
after the three lines calling speakOutputFile(...) lines 172, 181 and 191This would allow a user to have a status node (pointing at this node) send the output msg to a switch node and check if msg.status.text == 'done' and then continue processing knowing the audio was done.