2011-11-22 82 views
-1

嗨試圖流式音頻,但我得到以下錯誤不斷兩天... PLZ告訴我我要去哪裏錯.... PLZ清除我如何克服這...Android 2.2 MediaPlayer錯誤

DEBUG/MediaPlayer(497): Couldn't open file on client side, trying server side 
    INFO/StagefrightPlayer(34): setDataSource('http://stream.radiosai.net:8002/') 
    DEBUG/AudioDemo(497): LoadClip Done 
    DEBUG/dalvikvm(115): GC_EXPLICIT freed 689 objects/39080 bytes in 150ms 
    INFO/AwesomePlayer(34): calling prefetcher->prepare() 
    INFO/Prefetcher(34): [0x677328] cache below low water mark, filling cache. 
    INFO/AwesomePlayer(34): prefetcher is done preparing 
    DEBUG/AudioDemo(497): Stream is prepared 
    DEBUG/AudioSink(34): bufferCount (4) is too small and increased to 12 
    WARN/AudioFlinger(34): write blocked for 77 msecs, 4773 delayed writes, thread 0xb3f0 
    ERROR/AwesomePlayer(34): Not sending buffering status because duration is unknown. 
    DEBUG/dalvikvm(387): GC_EXPLICIT freed 167 objects/11832 bytes in 141ms 
    WARN/AudioFlinger(34): write blocked for 82 msecs, 4804 delayed writes, thread 0xb3f0 
    DEBUG/dalvikvm(262): GC_EXPLICIT freed 44 objects/2032 bytes in 143ms 
    WARN/AudioFlinger(34): write blocked for 73 msecs, 4841 delayed writes, thread 0xb3f0 
+0

您是使用模擬器還是真實設備? –

+0

顯示代碼請 – alezhka

+0

@alezhka http://stackoverflow.com/questions/3595491/is-android-2-2-http-progressive-streaming-http-live-streaming/3595740#3595740我只使用此代碼 – user1051599

回答

0

開放.PLS鏈接:

public ArrayList<String> readURLs(String url) {    
      if(url == null) return false; 
      ArrayList<String> allURls = new ArrayList<String>(); 
      try { 

       URL urls = new URL(url); 
       BufferedReader in = new BufferedReader(new InputStreamReader(urls 
         .openStream())); 
       String str; 
       while ((str = in.readLine()) != null) { 
        allURls.add(str); 
       } 
       in.close(); 
       return allURls ; 
      } catch (Exception e) { 
       e.printStackTrace(); 
       return null; 
      } 
     } 

然後解析鏈接和播放。

+0

我需要刪除我的play()方法並使用這個權利..? – user1051599

+0

步驟:1.讀取URL,2.解析鏈接3.準備流4.播放 http://stackoverflow.com/questions/6688758/streaming-m3u-audio – alezhka

+0

@alezhka ...雅我會嘗試..如果你是否發佈了一個例子..... – user1051599