1

我目前有一個SWF應用程序,可以記錄音頻並將其保存到FMS。然後在Flash Professional中,我嘗試使用FLVPlayback組件播放錄製內容,但它從不播放。音頻FLVPlayback不起作用

錄音會保存在此處:RootInstall/applications/myapp/streams/folder/audioFile.flv

然後,我有我的FLVPlayback組件的源看着rtmp://server-ip/myapp/streams/folder/audioFile但我不能讓它發揮。

我也複製了錄製的音頻文件,並將其固定在vod應用程序中,但無法播放它。當我嘗試sample.flv視頻時,他們工作。

這裏是我是如何記錄的音頻在AS3:在記錄側

nc.connect("rtmp://server-ip/myapp/folder"); 
... 
ns = new NetStream(nc); 
ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); 

mic = Microphone.getMicrophone(); 
ns.attachAudio(mic); 

// start publishing 
ns.publish("audioFile", "record"); 

回答

0

一切都是正確的,這是我嘗試讀取FLV是不正確的方式。

根據以上代碼,我編碼爲player

... 
nc = new NetConnection(); 
nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); 
nc.connect("rtmp://server-ip/myapp/folder"); 


private function netStatusHandler(event:NetStatusEvent):void 
{ 
    trace(event.info.code); 
    switch (event.info.code) 
    { 
     case "NetConnection.Connect.Success" : 
      //Connected Successfully 
      playLiveStream(); 
      break; 
     case "NetConnection.Connect.Rejected" : 
      // Connection Rejected 
      break; 
     case "NetConnection.Connect.Failed" : 
      // The server may be down or unreachable 
      break; 
     case "NetConnection.Connect.AppShutDown" : 
      // The application is shutting down 
      nc.close(); 
      break; 
     case "NetConnection.Connect.Closed" : 
      //Connection Closed 
      break; 
    } 
} 

private function playLiveStream():void { 
    nsPlay = new NetStream(nc); 
    nsPlay.client = this; 
    nsPlay.bufferTime = 0.1; 
    nsPlay.play("audioFile", -1); 
} 
相關問題