0
我使用red5和flex。實際上,我的目標是將麥克風流從服務器發送到客戶端,並在客戶端播放。同樣,將麥克風流從客戶端發送到服務器,然後在服務器端播放。無需存儲直播信息流。red5:我怎麼發送麥克風流?
這可能嗎?我怎麼能在red5和flex中做到這一點?
我使用red5和flex。實際上,我的目標是將麥克風流從服務器發送到客戶端,並在客戶端播放。同樣,將麥克風流從客戶端發送到服務器,然後在服務器端播放。無需存儲直播信息流。red5:我怎麼發送麥克風流?
這可能嗎?我怎麼能在red5和flex中做到這一點?
private var nc:NetConnection;
private var mic:Microphone;
private function init():void
{
nc=new NetConnection ;
nc.connect (your rtmppath,"anchor");
mic=Microphone.getMicrophone();
mic.rate=11;
nc.addEventListener (NetStatusEvent.NET_STATUS,checkConnect);
}
private function checkConnect (e:NetStatusEvent)
{
good=e.info.code == "NetConnection.Connect.Success";
if (good)
{
this.attachAudio (mic);
this.publish (stream,"live");
}
}
從客戶端,播放現場聲音,與目前的netconnection還連接您的NetStream:
private var nc:NetConnection;
private var mic:Microphone;
private var netstream:NetStream = new NetStream
private function init():void
{
nc=new NetConnection ;
nc.connect (your rtmppath,"viewer");
nc.addEventListener (NetStatusEvent.NET_STATUS,checkConnect);
}
private function checkConnect (e:NetStatusEvent)
{
good=e.info.code == "NetConnection.Connect.Success";
if (good)
{
var vid:Video = new Video
this.attachNetStream(ns)
netStream.play(presentation);
}
}
謝謝大家的響應。我已經嘗試過,但服務器端代碼不清楚。在服務器端,我無法獲得麥克風字節。我怎樣才能以客戶端編程方式在服務器或服務器麥克風流上播放客戶端流? – 2011-12-22 14:18:05