How to control volume sound on cpp target?

How to control volume sound on cpp target?

CPP target, where i go from here?
sndenemyExplosion = Assets.getSound(“sound/explode.wav”);???

HTML5 target -> this work on html5,
enemyExplOptions = {src: [‘sound/explode.wav’]};
sndenemyExplosion = new Howl(enemyExplOptions);
sndenemyExplosion.volume(0.05);

The sound itself won’t play until you do “.play()”

That will return a “SoundChannel” object that has a transform where you can set a volume

Shoot, thanks man. i figured it out. i just need to set the value to something like sound.volume= 0.02, instead of sound.volume= 0.2.

THIS WORKS NOW

sndenemyExplosion = Assets.getSound(“sound/explode.wav”);

	channel = sndenemyExplosion.play();
	var transform:SoundTransform = new SoundTransform();
	transform.volume = 0.02;
	channel.soundTransform = transform;
1 Like