# Need help to setup Play sound node

**URL:** <https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004>\
**Category:** General\
**Created:** [10 December 2021 11:35 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004 "2021-12-10T11:35:09Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![funhall](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/funhall/32/36062_2.png) [@funhall](https://discourse.nodered.org/u/funhall)\
**Post date:** [10 December 2021 11:35 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/1 "2021-12-10T11:35:09Z")

</div>

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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/0/8034ddcd3f47966cb5eb0aa7b61f5797819c93fc.png)  
looking forward to hear from someone.

Martin

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 December 2021 12:56 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/2 "2021-12-10T12:56:58Z")

</div>

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](https://github.com/MattVador/node-red-contrib-play-sound/issues/6)

---

<div class="post-metadata">

**Author:** ![funhall](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/funhall/32/36062_2.png) [@funhall](https://discourse.nodered.org/u/funhall)\
**Post date:** [10 December 2021 13:27 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/3 "2021-12-10T13:27:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 December 2021 20:50 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/4 "2021-12-10T20:50:59Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![funhall](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/funhall/32/36062_2.png) [@funhall](https://discourse.nodered.org/u/funhall)\
**Post date:** [10 December 2021 21:41 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/5 "2021-12-10T21:41:49Z")

</div>

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....

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 December 2021 22:05 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/6 "2021-12-10T22:05:31Z")

</div>

Please export your flows and attach them to a response

---

<div class="post-metadata">

**Author:** ![funhall](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/funhall/32/36062_2.png) [@funhall](https://discourse.nodered.org/u/funhall)\
**Post date:** [10 December 2021 22:18 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/7 "2021-12-10T22:18:08Z")

</div>

It is a pretty much complex flow. This is one flow out of 7.  
[flows.json](https://discourse.nodered.org/uploads/short-url/vME8KNvdB1XXPAwG1J4R2M3DYUU.json) (78.7 KB)  
Can you use this???

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 December 2021 23:58 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/8 "2021-12-10T23:58:12Z")

</div>

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](https://bastienbourdon.com/2016/raspberrypi-usb-sound/) Note: it is from 2016....

---

<div class="post-metadata">

**Author:** ![funhall](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/funhall/32/36062_2.png) [@funhall](https://discourse.nodered.org/u/funhall)\
**Post date:** [14 December 2021 19:29 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/9 "2021-12-14T19:29:13Z")

</div>

Yes but it is quit simple.

> **[Untitled - Pastebin.com](https://pastebin.com/TDipxpNv)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

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

---

<div class="post-metadata">

**Author:** ![funhall](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/funhall/32/36062_2.png) [@funhall](https://discourse.nodered.org/u/funhall)\
**Post date:** [30 December 2021 12:26 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/10 "2021-12-30T12:26:22Z")

</div>

Hi Zenofmud

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

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [30 December 2021 16:20 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/11 "2021-12-30T16:20:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![funhall](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/funhall/32/36062_2.png) [@funhall](https://discourse.nodered.org/u/funhall)\
**Post date:** [30 December 2021 16:36 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/12 "2021-12-30T16:36:27Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [31 December 2021 10:43 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/13 "2021-12-31T10:43:05Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![funhall](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/funhall/32/36062_2.png) [@funhall](https://discourse.nodered.org/u/funhall)\
**Post date:** [31 December 2021 11:14 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/14 "2021-12-31T11:14:54Z")

</div>

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.

 ![image002.png](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/8/2824e142591ed87e0a2a6b09a3fc03d72c7c0286.png)

Venlig Hilsen / Best regards

Martin Kristensen

![image001.png](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/6/f6a9201dfc603d152a09679858a42e7fc085e506.png)

Funhall

Venøvej 1

DK - 8800 Viborg

TLF +45 3141 2060 Mobil +45 2819 3616

[www.funhall.dk](http://www.funhall.dk)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [31 December 2021 11:50 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/15 "2021-12-31T11:50:18Z")

</div>

> [@funhall](#):
>
> No I just want to use this play-audio node up. But Can’t start it up.

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

- [mplayer](https://thisdavej.com/node-js-playing-sounds-to-provide-notifications/www.mplayerhq.hu/)
- [afplay](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/afplay.1.html)
- [mpg123](https://www.mpg123.de/)
- [mpg321](http://mpg321.sourceforge.net/)
- [play](https://linux.die.net/man/1/play)
- [omxplayer](http://elinux.org/Omxplayer)

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.

---

<div class="post-metadata">

**Author:** ![funhall](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/funhall/32/36062_2.png) [@funhall](https://discourse.nodered.org/u/funhall)\
**Post date:** [31 December 2021 12:09 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/16 "2021-12-31T12:09:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![funhall](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/funhall/32/36062_2.png) [@funhall](https://discourse.nodered.org/u/funhall)\
**Post date:** [31 December 2021 12:16 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/17 "2021-12-31T12:16:13Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/6/d6a06ce98ad0cb5a55a4c657fa3f82e988264038.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [31 December 2021 12:19 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/18 "2021-12-31T12:19:19Z")

</div>

> [@funhall](#):
>
> I get thisWarnings on the picture

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

---

<div class="post-metadata">

**Author:** ![funhall](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/funhall/32/36062_2.png) [@funhall](https://discourse.nodered.org/u/funhall)\
**Post date:** [31 December 2021 12:50 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/19 "2021-12-31T12:50:06Z")

</div>

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??

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [31 December 2021 13:20 UTC](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004/20 "2021-12-31T13:20:06Z")

</div>

> [@funhall](#):
>
> okay so it is installed right then?

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?...

> [@funhall](#):
>
> I can start the sound file but not stop it again

According to the documentation for `node-red-contrib-play-sound` you simply send "stop" to the node: [node-red-contrib-play-sound - npm](https://www.npmjs.com/package/node-red-contrib-play-sound) \<\< read this.

[Next page](https://discourse.nodered.org/t/need-help-to-setup-play-sound-node/55004.md?page=2)
