Groups | Blog | Home
all groups > macromedia flash flashcom > september 2006 >

macromedia flash flashcom : how to broadcast the Audio with netstream



sshah99
9/4/2006 12:00:00 AM
Hi,
I am developing an application where in i broadcast the audio and
video to other users with netconnection and netstream objects. I am able to
send and receive the video of the users but i am not able to broadcast the
audio. The code which i have used is as follows:
ns = new NetStream(nc);
var mic=Microphone.get();
var cam = Camera.get();
ns.attachVideo(cam);
ns.attachAudio(mic);
guest_1.video.attachVideo(cam);
guest_1.video.attachAudio(mic);
ns.publish(id);
Can anyone please help me why i am not able to send and receive the audio.Any
help would be appreciated.
Melvin_Draco
9/11/2006 11:59:31 AM
To broadcast audio/video you have to make two separated NetStream objects....
one to publish and another to play. Something like this:

// publisher
out_ns = new NetStream(nc);
var mic=Microphone.get();
var cam = Camera.get();
out_ns.attachVideo(cam);
out_ns.attachAudio(mic);
out_ns.publish( id );

// guests
in_ns = new NetStream(nc);
guest_1.video.attachVideo(in_ns);
guest_1.attachAudio(in_ns);
in_ns.play( id );
sshah99
9/12/2006 12:00:00 AM
Hi Malvin,
Thanks a lot for the reply.But the problem is that i have
two fla one which is broadcasting the audio/video and the other which is
receiving the audio/video, similar to the one at
http://www.adobe.com/devnet/flashcom/articles/broadcast_receiver_03.html

Now when i run broadcaster.swf and receiver.swf with streamname "abc" then it
works. But when i run another instance of broadcaster.swf and receiver.swf with
streamname "xyz" then quality of audio is deteriorated. I m not able to hear
the other person audio.

Can u please help me out.
AddThis Social Bookmark Button