Sounds play twice on iOS

I am using the latest versions of OpenFL (8.9.5), Lime (7.6.3) and HaxeFlixel (4.6.3).

On iOS I noticed that sound effects play twice, with a fraction of second between them. This happens on both simulator and device. Strangely, when playing music, I can sometimes hear the first beat of the song playing twice, but after that it seems to play normally.

Any idea of what could be causing this? Thanks.

There’s a memory improvement for Howler.js in the dev version of Lime here:

…but I don’t think that would effect a double-playing of sounds

Oh on iOS, hmm. Is this a regression? When did this start occurring?

Sorry, I’m not sure what you mean by regression. It was working before with OpenFL 8.4.1, Lime 7.0.0 and HaxeFlixel 4.5.1. Haxe was also upgraded from 3.x to 4.

Also, what’s strange is that the problem doesn’t seem very consistent. Some sounds seem to play twice only sometimes, while with others I can’t really tell if it’s playing twice or not. I have another, simpler app that doesn’t seem to have the issue.

I checked if it could be due to a difference in audio format, but all of the files are ogg, 44100Hz, 32-bit.

Can you attach one of the buggy sound files?
Also can you show code example, how you play them?

Sure. This sound always plays double, I tested in both wav and ogg:

land.wav
land.ogg

I play it by simply calling FlxG.sound.play("assets/sounds/land.ogg") or FlxG.sound.play("assets/sounds/land.wav"). I did a simple test within the game to just play the sound when I tap, so I’m sure I wasn’t playing it twice in different parts of code.