1

I have a video chat application where there can be 6 participants. What I would like to do is give the option to each publisher to control their own stream's volume. The code I have looks like this.

[global]
private var volumeTransform:SoundTransform;

[In the init method where ]
outgoingStream = new NetStream( nc );
....
volumeTransform = outgoingStream.soundTransform;

[In adjustVolume method]
....
volumeTransform.volume = event.value;
outgoingStream.soundTransform = volumeTransform;

Any ideas why this would not work?

-- EDIT A POSSIBLE SOLUTION --
A possible solution can be this : Calibrate the slider and set the microphone gain, a gain of zero effectively is mute and a gain of 100 is full volume. Seems to work for me.

gunz_rozez
  • 21
  • 3
  • 1
    Does a `NetStream` allow you to set/change the `soundTransform` at all? – iND Jan 03 '12 at 19:24
  • Yes it does, when I set the debug output for the netstream object I see the value I set `Logger.debug("NS : NS : " + ObjectUtil.toString(outgoingStream.soundTransform.volume));` – gunz_rozez Jan 03 '12 at 19:26
  • I cannot see anything very wrong with this . . . sorry I can't be more help. Maybe post more code? – iND Jan 04 '12 at 00:52
  • Is there something specific you would like to see in code? The one thing I am doing is sending H.264 encoded live streams. – gunz_rozez Jan 04 '12 at 02:34
  • No, if the `outgoingStream.soundTransform` volume is actually changing, then I would not know where to look next. I would definitely start some debugging sessions, and step through the code, if possible, and also use tools like Firefox's FireBug to watch the traffic . . . or, having access to the server, run a variety of tests at that end. I'm at a loss, and I hope someone else can fill in the gaps. – iND Jan 04 '12 at 04:34
  • A possible solution can be this : Calibrate the slider and set the microphone gain, a gain of zero effectively is mute and a gain of 100 is full volume. Seems to work for me. – gunz_rozez Jan 04 '12 at 18:34
  • I managed the same problem only with Microphone#gain. Also weird for me why changing NetStream's SoundTransform does not affect captured volume =/ – average dev Jan 05 '12 at 11:25

1 Answers1

1

I don't think you can do what you are asking for, you need to use the Microphone.gain property (as noted in the edited comment above).

You could conceivable write some code to send messages between the chat participants allowing an admin (or all users) to modify someone else's mic gain.

Sunil D.
  • 17,983
  • 6
  • 53
  • 65