I am using tweenlite to fade out sound, the fade out effect itself is working well, but it seems that everytime soundTransform is applied to soundChannel with tweenlite some noise like a crackle appears.
You can test it here here
And here is the code:
package {
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.media.SoundTransform;
import com.greensock.*;
import com.greensock.plugins.*;
TweenPlugin.activate([VolumePlugin]);
public class SoundFade extends Sprite {
public var keySound:Sound;
public var keySoundChannel:SoundChannel;
public var keySoundTransform:SoundTransform;
public function SoundFade():void {
keySound = new MySound();
keySoundChannel = new SoundChannel();
btn.addEventListener(MouseEvent.CLICK, onClick);
}
private function onClick(e:MouseEvent):void {
keySoundChannel = keySound.play();
TweenLite.to(keySoundChannel, 0.5, {
volume: 0
});
}
}
}
Does anyone have an idea how to work around this issue?
I believe you guys can help me with the problem. Thanks in advance.