Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can’t get node ‘play soundfile’ to work #1

Open
jerxjac opened this issue Mar 9, 2021 · 6 comments
Open

Can’t get node ‘play soundfile’ to work #1

jerxjac opened this issue Mar 9, 2021 · 6 comments

Comments

@jerxjac
Copy link

jerxjac commented Mar 9, 2021

I installed " node-red-contrib-play-soundfile " but can't get it to work.
I'm working under Windows 10
This is a little test flow with a link to my soundfile on D:/
Tried both D:\ and D:/

[{"id":"47945222.9bd43c","type":"play-soundfile","z":"76a6fe94.1adb4","name":"MP3","directory":"c9ba187.d1a6ee8","file":"TEST.mp3","allow_multiple":true,"x":290,"y":120,"wires":[["6a739113.f47cd"]]},{"id":"a448cac7.f3f1f8","type":"inject","z":"76a6fe94.1adb4","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"start","x":160,"y":120,"wires":[["47945222.9bd43c"]]},{"id":"6a739113.f47cd","type":"debug","z":"76a6fe94.1adb4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":450,"y":120,"wires":[]},{"id":"c9ba187.d1a6ee8","type":"soundfile-directory","directory":"D:/"}]

But the Debug is giving:

3/9/2021, 12:23:33 PMnode: MP3
msg : string[35]
"Error playing back file D:\TEST.mp3"

I also asked this question on node-red forum but the person who tried to help couldn't get it to work either. (Ubuntu)

please help

@lutzer
Copy link
Owner

lutzer commented Mar 9, 2021

Hey, this node currently relies on the npm package "play-sound". The package requires an audio player to be installed and added to the PATH. Here you can see a list of supported audioplayers: https://github.com/shime/play-sound. For windows problems specifcly, check this issue: shime/play-sound#39.
I might migrate it to another package in the future, but for now this is the only solution.

@marc-gist
Copy link

I cannot get this to work either. I have multiple players installed and the play-sound on a raspberrypi. how do you select which cli player to use?

@msaldivar7
Copy link

i start having this issue in an ubuntu server device, i'm able to reproduce the audios using mpg321 from the command line but when i try to play them using node-red program i get the "Error playing back file"

@lutzer
Copy link
Owner

lutzer commented Nov 14, 2023

I cannot get this to work either. I have multiple players installed and the play-sound on a raspberrypi. how do you select which cli player to use?

it should select a player automatically. Make sure one of the players specified in the README is installed. you can test the players in the command shell.

@lutzer
Copy link
Owner

lutzer commented Nov 14, 2023

i start having this issue in an ubuntu server device, i'm able to reproduce the audios using mpg321 from the command line but when i try to play them using node-red program i get the "Error playing back file"

what is the error code? is there any number specified after the error?

@jussikoskinen
Copy link

I also get an error: "Error playing back file /home/pi/click.mp3: 1"
I have mpg123 installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants