goldfire / howler.js

Javascript audio library for the modern web.
https://howlerjs.com
MIT License
24.03k stars 2.24k forks source link

Support for modifying src #1602

Open ZKJGOLD opened 2 years ago

ZKJGOLD commented 2 years ago

Feature Proposal

need to be re-instantiated each time when src for audio is changed,Can you reduce the overhead of unnecessary audio creation.

Possible Implementation

No response

fromage9747 commented 1 year ago

@ZKJGOLD

I found this https://github.com/goldfire/howler.js/issues/825

I cannot use it, as _src is unknown in typescript. Maybe you will have better luck.

I am currently unloading Howl, changing the source and reinitialising it to change a track.

fromage9747 commented 1 year ago

Chrome on Mobile doesn't work well. It will change the source, but it will download the entire file before it plays when the source has changed even though the player is initialised and reinitialised with html5:true

Initial load of the source works as expected, with html5:true

fromage9747 commented 1 year ago

Further to this. It only happens when using 3g and not on Wi-Fi. You can check the network tab in chrome and when on 3g it downloads the entire file after changing the source, but on Wi-Fi it works as I would expect where it streams the file.

ZenenTreadwell commented 1 year ago

Yea it seems like a nice library but there's no way I'm picking it up until it can do something like that. Different use cases, I suppose.

fromage9747 commented 1 year ago

@ZenenTreadwell yeah, like most people that start using this library, I moved away from it and just use the standard browser audio. This library is more suited for game that need to play many different audio files at once.