uncompress() not implemented for MobileWebAudioSound, but compressed sounds possible on mobile html5
MoritzBrueckner opened this issue · 0 comments
Describe the bug
MobileWebAudioSound.uncompress
immediately calls done
without any actual decompression, but the LoaderImpl
might create MobileWebAudioSound
objects with compressed audio files such as Ogg Vorbis:
Kha/Backends/HTML5/kha/js/MobileWebAudioSound.hx
Lines 34 to 36 in 9cd3174
Kha/Backends/HTML5/kha/LoaderImpl.hx
Lines 134 to 135 in 9cd3174
Thus, on mobile browsers you might get a compressed sound that you can't use with Audio2.play()
because there is no way to uncompress them (apart from manually doing this, of course).
To Reproduce
Load an .ogg Vorbis sound on the html5 target in a mobile browser (or in a desktop web browser with mobile emulation).
Execution Environment:
- Host system (where you compile your code): Windows 10
- Target system (where you run your code):
- Windows 10 + Firefox (mobile emulation)
- DuckDuckGo on Android
- Kiwi Browser on Android (this one has devtools)
- IDE used (if any): VSCode
- Kha revision: 9cd3174
Additional context
It would probably work to copy uncompress()
from WebAudioSound
, although (slightly off-topic) this definitely needs some work as well, as distributing the work over many frames even if the frame's workload is small is needlessly slow (sometimes > 10 seconds for music, for example).