Question
cannot maintain voice on a live stream.. help me sleep
I've been stuck for about 2 weeks now and would like to be
able to sleep normal hours some day .... if someone could give me a
hand, I'd really really really apprecate it!
I'm trying to setup a basic voice chat system using Media Server 2 and Flex2. The voice works but only for about 15 seconds then the server closes the voice stream subscriptions. I've tried to capture every error under the sun, but nothing shows.
The code uses a server call back to tell other clients to subscribe to a newly published stream. Output tracing shows it works and it IS possible to talk.. for a little while. Then it all goes dead. The management consule shows the listening streams disappearring. Reloading the app, it works again for 10 seconds to a minute.
Is there something obviously wrong in my code? I don't know if there is some sort of 'timeout' or perhaps I need to ping to keep the connection alive? Any ideas where to start looking?
private var ui:UIComponent; //global var in the class
private var out_VoiceStream:NetStream; //global var in the class
private var m_nc:NetConnection; //used globally for all connections to the server
private function publishMicStream( userName:String ):void {
out_VoiceStream = new NetStream(m_nc);
out_VoiceStream.attachAudio( mic );
out_VoiceStream.publish( "audioStream_" + userName, "live");
}
public function subscribeToVoiceStream( p_userName:String ): void {
var in_voiceStream:NetStream;
var video:Video;
in_voiceStream = new NetStream( m_nc );
video = new Video(2,2);
video.attachNetStream(in_voiceStream);
ui = new UIComponent();
in_voiceStream.play( "audioStream_" + p_userName);
in_voiceStream.receiveVideo(false);
in_voiceStream.receiveAudio(true);
ui.addChild(video);
}
I'm trying to setup a basic voice chat system using Media Server 2 and Flex2. The voice works but only for about 15 seconds then the server closes the voice stream subscriptions. I've tried to capture every error under the sun, but nothing shows.
The code uses a server call back to tell other clients to subscribe to a newly published stream. Output tracing shows it works and it IS possible to talk.. for a little while. Then it all goes dead. The management consule shows the listening streams disappearring. Reloading the app, it works again for 10 seconds to a minute.
Is there something obviously wrong in my code? I don't know if there is some sort of 'timeout' or perhaps I need to ping to keep the connection alive? Any ideas where to start looking?
private var ui:UIComponent; //global var in the class
private var out_VoiceStream:NetStream; //global var in the class
private var m_nc:NetConnection; //used globally for all connections to the server
private function publishMicStream( userName:String ):void {
out_VoiceStream = new NetStream(m_nc);
out_VoiceStream.attachAudio( mic );
out_VoiceStream.publish( "audioStream_" + userName, "live");
}
public function subscribeToVoiceStream( p_userName:String ): void {
var in_voiceStream:NetStream;
var video:Video;
in_voiceStream = new NetStream( m_nc );
video = new Video(2,2);
video.attachNetStream(in_voiceStream);
ui = new UIComponent();
in_voiceStream.play( "audioStream_" + p_userName);
in_voiceStream.receiveVideo(false);
in_voiceStream.receiveAudio(true);
ui.addChild(video);
}
