Sound Issue [AL lib: (EE) alc_cleanup: 1 device not closed]

Hello openfl community!

I’ve been working on a game in HaxeFlixel, encountering errors regarding the playback of sound throughout development.

The most pressing issue occurs using FlxTypeText, an addon class used to type text letter by letter, playing a sound each time a letter is typed.

The sound is sure to cut out after too many subsequent plays, cutting out the sound in question and moments later all other sounds, with all sound returning upon a de/refocus of the game.

I handle the sound like this, abbreviated for readability:

<sound path="skulltalk1.wav" id="typesfx1" />
public var TypeSFX:FlxSound;
TypeSFX = FlxG.sound.load("typesfx1");
Text.start(0.5, false, false, TypeSFX, [Reg.NoKey], isComplete);

The FlxTypeText Class:

I’ve been suggested to try using the next build of openfl rather than legacy, which introduced multiple other issues like fades not working, text line spacing and antialiasing issues, as well as frequent hitching and crashes. Apart from this, I’m completely in the blue on what to do about this other than not using sounds for typing letters at all, a feature I would not like to just drop, so I’d be thankful for any kind of help.

The second issue is the [Sound.hx:118: Error] being thrown on each odd run of the game, which, oddly enough, seems to only happen on my end, though.

Furthermore, neko builds seem to be crashing trying to use .wav files, throwing the same “AL lib: (EE) alc_cleanup: 1 device not closed” error, pointing to line 241 of FlxSound while working fine on windows. Though I would figure that is a known issue.

Forgot to mention that the master branch of FlxTypeText is what I’m using.

A very interesting development:

After updating my libraries, I’m now getting a multitude of this while debugging through cmd whenever the sound cuts out:

It’s even happening with the FlxTypeText project from the flixel-demos master branch, without any change from my side save for compiling it to windows cpp. It does not occur when disabling aero designs within windows. I’m stumped.

No idea about your problem,

but just so you know “AL lib: (EE) alc_cleanup: 1 device not closed” isn’t an error message, it’s a warning telling that a sound device wasn’t closed. It happens because the game crashed and openfl couldn’t close it like it normally would in a normal exit.

Ah, bummer. It’s the only thing to go by with an error happening on the engine’s side save for the OpenAL errors.