node-red-contrib-play-sound: Dont stop on Raspberry Pi3?

1,667 views
Skip to first unread message

Diogo Zanardini

unread,
Sep 29, 2017, 10:40:01 AM9/29/17
to Node-RED



hello

I Installed this node:
https://www.npmjs.com/package/node-red-contrib-play-sound
on my aplication on my pc (Ubuntu) work perfect,
start, stop, pause and resume commads respond very well...

but an identical application on Raspberry Pi3 stop command does not work





Does anyone use this tool, and had the same problem?
Can anyone give me any idea why this bug?


thank you again in advance

Colin Law

unread,
Sep 29, 2017, 10:43:29 AM9/29/17
to node...@googlegroups.com

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/de6d519b-2f3f-4ef2-9d25-dd9f2ac2472b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Diogo Zanardini

unread,
Sep 29, 2017, 11:22:08 AM9/29/17
to node...@googlegroups.com
Hello Colin, 

yes, that's exactly it!
I'm using the HDMI sound output
and when I try to use the audio-jack, no sound comes out ...

Maybe need some output configuration for audio-jack or HDMI?

I'm going to focus my research on this ...

Thanks alot again!
always fast to answer

[ ]´s
Diogo Zanardini

You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/l5FJi7_46RA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Diogo Zanardini

unread,
Sep 29, 2017, 11:47:35 AM9/29/17
to node...@googlegroups.com
I try this: (but still coming out to HDMI with no Stop control)




[ ]´s
Diogo Zanardini

Diogo Zanardini

unread,
Sep 29, 2017, 2:00:50 PM9/29/17
to node...@googlegroups.com
update:

(allready working!)

As an alternative to the problem I decided to use HTML5 Audio and javascript in the template node to control sounds based on HTML Audio/Video DOM Reference:
https://www.w3schools.com/tags/ref_av_dom.asp

like this:

<!DOCTYPE html> 
<html> 
<body> 

<div style="text-align:center"> 
  <button onclick="playPause()">Play/Pause</button> 
  <br><br>
  <audio id="audio1" >
    <source src="audio1.mp3" >
  </audio>
</div> 

<script> 
var myAudio = document.getElementById("audio1"); 
function playPause()
{ 
    if (myAudio.paused)
    {
    	myAudio.currentTime = 0;
        myAudio.play();
    }
    else
    {
        myAudio.pause(); 
    }
} 
</script> 

</body> 
</html>

[ ]´s
Diogo Zanardini

Diogo Zanardini

unread,
Oct 17, 2017, 3:02:25 PM10/17/17
to Node-RED
hello again...

I would like to know if node-red is allowed to control the sound outputs ...
because I used the command:
amixer cset numid = 3 1
according to the site: https://www.raspberrypi.org/documentation/configuration/audio-config.md

and all sounds come out of the jack,
except the sounds played within the node-red that continue to exit through the HDMI

it looks like the two exits are active ....
in the jack output, i can
hear all the sounds except that ones played from node-red-contrib-play-sound.
this sounds still getting out from HDMI
Weird...

Tom S.

unread,
Feb 21, 2018, 11:28:21 AM2/21/18
to Node-RED
Hi Diogo,

got the same problem. Cannot stop the sound on a raspberry pi 3 (very annoying!) and cannot force it out of the audio jack, even with amixer cset numid = 3 1 (found similar ressources), as long as there is a monitor connected. In my setup I cannot get rid of the monitor, so I would appreciate any update to the node, that allows to specify the output (I assume it is hardcoded to always use the automatic output)
...

Thanks!

Mark Setrem

unread,
Feb 21, 2018, 1:21:37 PM2/21/18
to Node-RED
As it's a contrib node, there is no guarantee the author reads this forum.
You would be better off opening an issue on the nodes github site, which has a better chance of the author reading it.

Dave C-J

unread,
Feb 21, 2018, 1:38:14 PM2/21/18
to node...@googlegroups.com
Though it's also no specifically for a Pi so no reason it should try to direct the output to anywhere other than the Operating system default
--
Sent from phone.

Diogo Zanardini

unread,
Feb 21, 2018, 2:09:54 PM2/21/18
to node...@googlegroups.com
In my project I need to play several sounds on several different speakers.
For this I need obviously several channels ...
so I used a usb sound card for each channel
and control each of them using the node: EXEC NODE with the command line:
mplayer -ao alsa: device = hw = 0.0 -af volume = 1: 0 "+ file; - 

when file is the path an file of your sound
and to select usb sound cards just change hw=0.0; to other numbers like: hw=1.0; hw=2.0 respectively

I do not know if this is what you want or if it solves your problem
but if the solution interests, I can explain better!

good luck with your searches

[ ]´s
Diogo Zanardini

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/l5FJi7_46RA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

steve rickus

unread,
Feb 21, 2018, 2:33:33 PM2/21/18
to Node-RED
Maybe this is a dumb question, but have you gone through the `raspi-config` menu items
`Advanced Options` -> `Audio`  and selected the "Force 3.5mm (headphone) jack"?
Reply all
Reply to author
Forward
0 new messages