Neko - SoundTransform causing crashing

The following code is causing my Neko build to consistently crash without a debug error being generated (upgraded today too openfl 3.3.2, lime 2.3.2).

zerovolume = new SoundTransform(0, 0);  
musicchannel = mymusic.play(0);    
musicchannel.soundTransform = zerovolume;

the crash occurs on the third line. I’ve experimented with using actuate to very quickly fade the volume to 0, e.g.

Actuate.transform(musicchannel, 0.01).sound(0, 0);

but i still hear the music start before the volume is zeroed ! , changing the time delay in the actuate transform to “0” also causes the same crash.

My intention is to start the music at zero volume, so i may fade it in over a few seconds. This works fine on the flash target, and also worked fine on Neko before i upgraded today (openfl 2.28, lime 2.13).

Is there a better way of starting music at zero volume?, or is this just a bug that i should log on github ?

Does it also happens when you target windows/mac/linux?

Does this sample https://github.com/openfl/openfl-samples/blob/master/PlayingSound/Source/Main.hx
openfl create PlayingSound
works for you?

It has these two lines: ```
channel = sound.play (position, 0, new SoundTransform (0, 0));
Actuate.transform (channel, fadeIn).sound (1, 0);

so maybe try putting the sound transform in the play call.

Thanks for your reply ibilon.

The above code works fine on Windows and Flash (I do not have mac and linux to test on)

I have tried adding the SoundTransform to the sound.play() line as you suggest. Whilst Neko doesn’t crash at that point, it also doesn’t apply the sound transform to the sound either!

This is the same in the PlayingSound example, on Neko the music starts at full volume. (although the included .ogg file does itself contain a fadein, which make it sound like it’s working properly when it isn’t !)

just spotted that Event.SOUND_COMPLETE isn’t firing on Neko either !, i guess i just have to add this to the bug list over at GitHub.

I think there were recent improvements to firing event complete events, etc

great, yup - just updated to lime 2.3.3, openfl 3.0.3 (from -0.0.1 of each) neko Event.SOUND_COMPLETE now fires on sound completion.

sound.play(sound,0,zerovolume) continues to ignore a soundtransform in Neko
musicchannel.soundTransform = zerovolume; still causes the application to crash (when used in the code in the OP)

The new update has introduced a strange further failure in Neko sound. after approx 45 sounds are played, my trace is flooded with the text “Could not initialize FreeType” and all sound effects cease to play!

Well that’s strange. Not sure what Freetype has to do with any of this!

Any interested in helping with this?

https://github.com/openfl/lime/blob/master/lime/audio/AudioSource.hx