Need help to setup Play sound node

I like to use play sound node but dont understand how to fill out the player options and the Audio options.
I have 2 setup- one with sound thru the HDMI and one on usb sound card.
I really hope someone can help me.
thanks in advance
image
looking forward to hear from someone.

Martin

I assume you are using node-red-contrib-play-sound so you may want to read this: How to serve up options to a player (AFPLAY tested) · Issue #6 · MattVador/node-red-contrib-play-sound · GitHub

Thank you so much for your quick reply.
Can you translate that to node-red language, please. I am not that clever to solve it from that explanation.
How and what do you put in the node under play option settings. I can start the sound file but not stop it again.

Let me ask a couple questions. You say you have two setups. Does that mean you are running two pi’s each with a node-red on it? One connected to a monitor via the hdmi port?
Does the monitor have a speaker attached?
You say you have a usb sound card…attached to what and what card is it?

Also what version of node-red, node.js (find this in the NR startup log) and what so are you running on the pi?

That so fine.
Nodered version 2.1.3. i am running this version on a virtual machine on a server. In this i control 2 RPI each also with version 2.1.3 with MQTT.
One is with a hdmi and using the tv speaker. The other one is with a Soundblaster play 3 USB.
Then i send the message to the pi for eact "system" and expedite the "orders" sorry for my bad english....
I hope you understand....

Please export your flows and attach them to a response

It is a pretty much complex flow. This is one flow out of 7.
flows.json (78.7 KB)
Can you use this???

Can you make an example flow showing what you want to do?

In the flow you provided you don't have node-red-contrib-play-sound.

Your best bet would be to do some research on how to play a sound from the command line to the devices you have. Once you get that working then working on getting it working from Node-RED.

If you haven't gotten the Soundblaster play 3 USB working yet, here is a link to a site I found you could try: Quickly setup a USB sound card on a Raspberry Pi 3 Note: it is from 2016....

Yes but it is quit simple.

I just wanna start and stop the pm3 file. With the node-red-contrib-play-sound.
I have no problem playing from the VLC by html request. So the sound works fine. It is the settings inside the Playsound node that need some Json code.
I hope you can help me.
Br. Martin

Hi Zenofmud

Could you help me how this Sound node works please???

First off, have you been able to play sound from the two pi’s outside of node-red?

Yes.
I play Sound from VLC with no problem.
I just want to play a background sound with VLC and then play smaller sound files over the back ground with this node. I just don’t know how to start the node.

Send from ny iPhone

Venlig Hilsen / Best regards
Martin Kristensen

Funhall
Venøvej 1
DK - 8800 Viborg
TLF +45 3141 2060 Mobil +45 2819 3616
www.funhall.dk
Autoriseret forhandler af Segway,

Oh, you want to use VLC, that s a media player while node-red-contrib-play-sound:

Node-RED node for play-sound (based on nodejs play-sound : Play sounds by shelling out to one of the available audio players)

It would have been useful if you mentioned VLC in the begining.

Have yo tried a google search 'node-red vlc' to see what you find?

No I just want to use this play-audio node up. But Can’t start it up.

Don’t find out what to write in the player options and Audio options and the other two inputs if necessary.

Venlig Hilsen / Best regards

Martin Kristensen

image001.png

Funhall

Venøvej 1

DK - 8800 Viborg

TLF +45 3141 2060 Mobil +45 2819 3616

www.funhall.dk

If you want to use this node, then you need to use a sound player on the Pi like

In my project I used AFPLAY and pointed you at the info I added to github to address using AFPLAY. There are some suggestions there that you should try out.

If you want to use VLC as the sound player, I can't help you since I havn't used it.

Ooooohhhh so no I think i am getting it. I need to install some of the displayed audio players to the PI before I can use the sound nodes in Node-red.
Is the best and easyest to use the afplayer you think? ANd do you have a link to it?
Thanks.

No I have installed the afplayer
But I am not sure it is installed correctly.
I get thisWarnings on the picture
I hope you can translate the danish or figure it out. But the command afplayer is not found.

you cant run node (JavaScript) in a bash terminal.

Thanks.
okay so it is installed right then?
Should I now could use the Node and what to write in the red input fields in the node??

No.

To install a node-red package via command line, you need to install it in a folder where the package.json file exists (e.g. in the .node-red folder). You ran the npm command in /home/pi

However, afplay is not a node-red package so I am not 100% certain why you are attempting to install this. Not to mention its for Apple Sound files (you are trying to play a wav file)!

I actually suspect you dont need this, but if you do, you probably want to install it globally using npm install -g afplay (but as i said, I am not convinced this is what you need)


I dont actually know what you are trying to achieve TBH. You said you got it to play a sound but couldnt stop it?...

According to the documentation for node-red-contrib-play-sound you simply send "stop" to the node: node-red-contrib-play-sound - npm << read this.