The following situation is happening: Even if the player touch or clicks in the game frame the first button that he interacts to does not play the audio and then the second button plays the audio two times.
After that the audio plays nicely. It’s just the first audio.
I tried creating a “Click to start” screen before any audio is needed to force the player to interact with the game, but even with that I’m still experiencing this first button no audio plays and second button plays audio twice.
Is this a Cocos bug or is this something about the browser?
In AudioManager.ts the playByKey just finds the clip and at the end call this:
public playOneShot(clip: AudioClip, volumeScale = 1) {
if (!this.isAudioEnabled)
return;
if (!clip)
return;
if (this.source)
this.source.playOneShot(clip, volumeScale);
else
logger.log(`ERROR: AudioSource is null`);
}