shime / play-sound

Play sounds by shelling out to one of the available audio players.
MIT License
208 stars 31 forks source link

not working in windows 10 x64 #39

Closed ferdiozer closed 2 years ago

ferdiozer commented 4 years ago

const player = require('play-sound')();

player.play('alert.mp3', (err) => { if (err) console.log(Could not play sound: ${err}); }); Error: Couldn't find a suitable audio player Error: INFO: Could not find files for the given pattern(s).

Thank you

kot-shrodingera commented 4 years ago

You need to install compatable console player (mplayer for example) and make it available in the shell (add mplayer folder to %PATH%)

ferdiozer commented 4 years ago

image

image

I can not. i guess i couldnt

kot-shrodingera commented 4 years ago

If you go to your project directory in cmd and type mplayer alert.mp3 is it playing?

ferdiozer commented 4 years ago

image

Yeah, it's ringing. It does not work anymore. It worked when I turned on the computer again. Thank you

ferdiozer commented 4 years ago

image Is that the right thing? system variables? or user variables?

kirax999 commented 4 years ago

I found a solution if other people have the same error

download mplayer in https://mplayerhq.hu/design7/dload.html scroll for middle page and download "windows Binaries" after download please uncompress

and copy mplayer.exe in main directory project

play-sound not use path in windows just search in main directory project

unional commented 2 years ago

The issue for Error: INFO: Could not find files for the given pattern(s). is caused by find-exec. 1.0.2 fixed it, but right now play-sound pinned to 1.0.1

shime commented 2 years ago

I've just published a new version that should fix this issue. Thanks for reminding me, @unional.

unional commented 2 years ago

Thank you! :)