Expand my Community achievements bar.

AudioSubscriber: how to move up/down volume

Avatar

Level 2

I'm playing with rtc:WebCamera and I would change the AudioSubscriber volume by a Slider.

Somethings like this, but  it don't works.

private function speakerVolumeChanged(e:SliderEvent):void
{
     audioSub.soundTransform.volume = e.value;
   
}    

thanks.

1 Reply

Avatar

Former Community Member

Hi,

You don't need to do on the subscriber side since a subscriber can have many streams. So, you might have to do for individual netStreams while will be tedious and you would have to override AudioSubscriber.

You should actually change the gain property in AudioPublisher ( soundTransform wont work because its only for loopback) .

We already have an example called Audio in sampleApps folder in which the gain slider is moved from 0 to 100 and on 0, you won’t get any sound on the other side.

Hope this helps

Thanks

Regards

Hironmay Basu