Some of people who played our demo report about crackling in our music.
It isn’t reproduce on my mac, but it 100% on android chrome (I know that it official unsupported) and on some PC with windows 10 and 8.1 (any browsers).
I can confirm that there’s some crackling on Android Chrome, but it’s as you say an unsupported platform. The game plays remarkably well on a phone btw!
Yes, I know. But the same crackling on windows pc - thats the issue.
I told about android only like a fast way to reproduce if you have no windows pc near.
I get this on Android (and html5). I originally thought it had something to do with the browser turning on and off its sound, because it didn’t happen when there was continuous sound playing. I forgot about it because I solved the issue by looping a silent audio clip forever.
Will need to investigate, but if the music is playing continuously and crackling it is possible that the sound thread does not fill in the sound buffers fast enough.
We do release audio focus when there is silence, but if there is constant music playing it should not come into effect.
Looks like Defold was directly ported to HTML5 by the use of Emscripten.
Does Defold use OpenAL for audio playback? Emscripten emulates OpenAL behavior by filling WebAudio AudioContext’s buffer every frame.
=> We’ll always hear cracklings because of inconsistent HTML5 frame time.
A clear example of the problem (Emscripten + OpenAL + OGG music):
@ross.grams, just to be clear here, do you get it when you bundle for Android or when you use a browser on Android?
Wan’t to make clear if this problem only manifests in browsers or on other platforms as well.
It might be that there are two things at play here, when you loop the silent audio clip I assume the gain for that sample and the group channel are not zero right? It is the sample data that is silent?