plunkettscott / interact-sound

A resource providing the ability to play sounds using the FiveM NUI environment.
https://plunkettscott.gitbooks.io/scott-s-script-documentation/content/scripts/interactsound.html
MIT License
63 stars 129 forks source link

Replaced buggy HTML5 Audio with howler.js #1

Closed patriksletmo closed 5 years ago

patriksletmo commented 5 years ago

During the development of another FiveM resource we noticed that the old implementation of InteractSound was acting strange and both cutting off, repeating, or refusing to play our audio files. It was difficult to predict when and if this would happen, but for some audio files this behavior was the norm rather than the exception.

By replacing the buggy HTML5 Audio implementation with howler.js (which defaults to Web Audio API and falls back to HTML5 Audio) all of our issues disappeared, so I figured I'd submit a pull request so that other can benefit from these changes too.

Note that I have not updated the zip file in the repository.

plunkettscott commented 5 years ago

Thanks for this. I haven't had any time to address these bugs, so I'm happy you took the tiem to do it.

patriksletmo commented 5 years ago

No worries. Thank you for the merge!