shime / play-sound

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

[BUG] Sound is looped #38

Closed angelhdzmultimedia closed 4 years ago

angelhdzmultimedia commented 4 years ago

Hello.

Sound is being looped. I'm running the sound on a setInterval at 80bpm. It plays good at first, then it starts to loop multiple times.

I tried setting the interval function as async and then calling await on the player.play(). Didn't solve it.

Hope you can help, thanks.

OS: Windows 10 Pro 64bit CLI Audio Player: Mplayer

kot-shrodingera commented 4 years ago

I also have similar issue. I use player.play('beep.wav') and file just infinitely loops. How can I play file only once?

angelhdzmultimedia commented 4 years ago

Solved

Workaround: I first check if the sound is playing and stop it. Then I start playing it again.

I hope it gets fixed, because if we do not mark the sound to be looped, it shouldn't loop.