PDA

View Full Version : Creating Audio Communications with Seperate Rooms


DukeRock
09-23-2005, 03:53 PM
I have created a netconnection with a couple of different rooms. The room "OP" has one other person in that room ready to play the stream when the publisher starts inputting the stream. This works fine and the other person is able to play the stream with no problem....the issue is that because the person publishing the stream is also in that room the publisher also hears the stream he is publishing in his own headset as the other person hears it. Any ideas on how I can publish this audio stream to this particular room and only the intended person in that room can play the stream and the sender doesn't hear his own voice coming through his headset ???

jaci
09-29-2005, 10:41 AM
Hi,

I would suggest the following..

1.While publishing the stream create the stream in the username or specific id any...

2.While playing the stream..You can check whether it is the same publisher's stream with the help of the username or id..and need not play that particular stream..

sample code:

ns = new NetStream(nc); // open stream within connection
ns.attachAudio(Microphone.get()); // capture audio
var publishing_stream= _global.username+"_audio";
ns.publish(publishing_stream);


//while playing the stream:
ns_out = new NetStream(nc);
for(i in room_user_list)
{
var play_stream = room_user_list[i]+"_audio";

if(play_stream != publishing_stream)
{
ns_out.play(play_stream)
}
}

Hope this helps..