Pausing or stopping an ongoing playback in node-red-contrib-play-sound

Hi everyone. I am running into a weird issue. Using node-red-contrib-play-sound. For the player, I put {} because I don’t know what player to specify.

Anyway, when I inject the standard message, it’s fine and it plays the music I want it to play. However, when I send an inject for msg.payload = pause or msg.payload = stop, it does nothing. The documentation says that all I need to do is send those payloads to stop the ongoing playback, but it doesn’t work. It may look like it stopped on the Node Red flow/module view, but on the device itself the audio continues playing until completion.

Does anyone know why this would be the case? I tried sending the payload as a string, expression, and a few other data types to test it out but it just doesn’t work.

Similarly, I tried this with node-red-contrib-play-soundfile and it also doesn’t work following the guide there. Again, it shows that it stopped only on the flow view but in reality the music keeps playing.

first off, what device are you running NR on?
What OS is it running/
What version of NR and node.js (you can get these from the node-red startup log)

One other thing you could try is the sox_play node in the node-red-contrib-sox-utils collection.

On further looking I don’t think you can pause the sox_play node

Hello, thank you for the response but I finally found out how to do it for myself.

Just FYI in case anyone else finds this, I am running NodeRed 1.3.5 on an RPi 3B+.

My solution was to use PlaySound node but I had to shell out to "aplay" in order for the commands to work. The other players did not work.

image

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.