Change live sound volume

I have something like this:

private var myVideo:Video;
public var videoDisplay:UIComponent;
...
videoDisplay.addChild(myVideo);
...
nsPlay = new NetStream(nc);
nsPlay.addEventListener(NetStatusEvent.NET_STATUS, nsPlayOnStatus);
nsPlay.bufferTime = 0;
nsPlay.play(pro);
myVideo.attachNetStream(nsPlay);

Does anyone know how I can change the volume of this stream, I would like to bind the volume to the slider

+5
source share
2 answers

Use the NetStream :: SoundTransform property .

nsPlay.soundTransform.volume = slider.value;

To bind the value of a slider to:

BindingUtils.bindProperty(nsPlay.soundTransform, "volume", slider, "value");

Set the range of sliders as 0 to 1

+3
source

Use the soundTransform property of the NetStream Object:

var st:SoundTransform=nsPlay.soundTransform;
st.volume=0.5; // 50% volume
nsPlay.soundTransform=st;
+3
source

All Articles