Skip to main content
September 4, 2006
Question

how to broadcast the Audio with netstream

  • September 4, 2006
  • 2 replies
  • 353 views
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.
    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    Inspiring
    September 11, 2006
    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 );
    September 12, 2006
    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.