HTML5 : Sound transforms not applied on play, Openfl 4.3.1

Hi, need help on the following example:

public function init() : Void
{
	sound = new Sound(new URLRequest("path/to/sound"));
	sound.addEventListener(Event.COMPLETE, onComplete);
}

function onComplete(evt : Event) : Void
{
	var transform : SoundTransform = new SoundTransform();
	transform.volume = 0;
	sound.play(0, 0, transform);
}

Note: I’m using volume of 0 to simulate a muted sound.
The sound transform doesn’t work and the sound plays at full volume.

Thanks

2 Likes

Thanks, this should be fixed now, doing a release soon :slight_smile:

Awesome thanks :smiley:

The new version is out :slight_smile:

1 Like

@singmajesty Thanks for the fix, but I’ve discovered a different problem… sometimes the sound plays even though a sound transform is applied with a volume of 0. Here is a simple example to simulate this:

public function init() : Void
{
	sound = new Sound(new URLRequest("path/to/sound"));
	sound.addEventListener(Event.COMPLETE, onComplete);
}

function onComplete(evt : Event) : Void
{
	var transform : SoundTransform = new SoundTransform();
	transform.volume = 0;
	
        addEventListener(Event.ENTER_FRAME, function(event){
			sound.play(0, 0, transform);
		});
}

I hope you can find a solution to this. Thanks in advance.

This is the code in Lime HTML5AudioSource that handles play() for Howler

Perhaps we could try doing something with muted in setGain, like if (gain <= 0) parent.buffer.__srcHowl.muted (true, id);

You can also see if the gain value is zero (as it should be in your example), but I believe it is

Sorry for the late reply. Ya, that sounds like a good approach. Hopefully you can get something sorted for 4.4.1

The sound is quiet when I test it, do you know how I can reproduce what you’re seeing?

Maybe i’m doing something else wrong then… Coz I’m getting that result with the 2nd example I gave you. I’ll have to take a look, this seems really odd now :confused:

I’ll try again, thanks :slight_smile:

Thanks, with your sample I can recreate – it starts bugging after around 128 audio channels for me, before that the sounds are properly muted (without any changes to the code)

I wonder if there’s a web audio sound limit, and it falls back to HTML5 audio after that?

I posted about it here, perhaps we’ll get more information

Oh good, I thought I was going mad. Thanks for the update. I’ll follow the link you posted. :sweat_smile:

I think this should solve it

1 Like

Awesome, thanks for keeping me updated :slight_smile: