shime / play-sound

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

Error: 1 #51

Open TECHNOPAWS opened 1 year ago

TECHNOPAWS commented 1 year ago
const player = require('play-sound')(opts = {});

player.play('path/to/soundfile.mp3', (err) => {
  if (err) {
    console.error('Error occurred: ', err);
  }
});

When I try to run the code, no sound is played and instead the console throws an error saying

Error occured: 1
timotheeg commented 1 year ago

What platform are you running this on? Do you have audio players installed and is your audio file supported?

On OSX, I install mplayer via brew and play-sound just works 👍

neksodebe commented 1 year ago

Had the same issue. Just did sudo apt install mplayer and all worked fine.

TheMatrix97 commented 9 months ago

I'm running this library with mpg321, and it throws the same error: 1. It would be interesting to provide more information about exceptions. In my case, the path to the audio file was wrong, which seems to be causing error: 1. Indeed, thanks for this library!