I can’t seem to get audio working on iOS HTML5 when using recent versions of OpenFL. I’ve tried using both .mp3 and .wav files. I’ve added the play command to an onMouseDown event, as I’m aware that iOS browsers require this for the audio system to be unmuted. I’ve tried using OpenFL and more directly through Lime. I’ve tried with the audio embedded, and not.
The problem doesn’t appear to exist in older versions of OpenFL, as I’ve found some older projects that do play audio, though nothing recent.
Any help would be appreciated!
Example Code
class Main extends Application {
private var soundA:AudioSource;
public function new () {
super ();
}
public override function onMouseDown (_, _, _, _):Void {
soundA = new AudioSource (Assets.getAudioBuffer ("assets/sound.mp3"));
soundA.play ();
}
}