pixijs / sound

WebAudio API playback library, with filters. Modern audio playback for modern browsers.
https://pixijs.io/sound/examples/
MIT License
409 stars 67 forks source link

v4.x doesn't respect `utils.supported`, which loads everything in `utils.extensions` anyway #237

Closed hmpthz closed 1 year ago

hmpthz commented 1 year ago

Recently I migrated my project from PixiJS v6 to v7, came along with @pixi/sound v5.x, only to find that soundAsset refused to load ogg files, as utils.supported['ogg'] turned out to be false on Safari, iPhone. I didn't even notice this problem when I was working on PixiJS v6 with @pixi/sound v4.x, so I tested my v6 project on iPhone again. All ogg sounds weren't played while there was no warning or exception had been thrown. After taking a quick look at the sourcecode of v4.x, it seems like utils.supported is not used for detecting valid extensions, instead, it simply registers all extensions using utils.extensions. Is this the intended behaviour? If not, maybe utils.extension have to be filtered before SoundLoader is added into PixiJS?

bigtimebuddy commented 1 year ago

Yes, that seems like a bug in v4 and the solution, like you suggest is probably to filter extensions by supported before using them in SoundLoader.

bigtimebuddy commented 1 year ago

Fixed. I'll working on a release for this.