Mp3 Streaming Using Player Switching

白昼怎懂夜的黑 提交于 2019-12-13 18:34:16

问题


I am developing a sample application which can play shoutcast mp3 streams (Developing for S40 platforms, CLDC 1.1, MIDP 2.0). I am using two players switching for continues play back.

I used the below logic for streaming.

Buffer enough chunks
Start Player1
Wait Player1 to finish
Start Player2
Wait Player2 to finish
repeat... 2

The problem is, listener can feel 1 Second silence (Gap) while switching between players.

I would like to know is it possible to stream audio from server without gaps (while switching the players)?

Here is my code for starting player:

Player p = Manager.createPlayer(is, type);
p.addPlayerListener(playerListener);
p.realize();
p.prefetch(); 

Player2 is prefetched before Player1 finishes - I created a FIFO queue for players, and when a chunk is downloaded, I create input stream -> Player -> Realize() -> Prefetch() -> Push into the Queue.


回答1:


There is this project too : mfradio.sourceforge.net but not maintened anymore and i did not get it to work on a "late" MIDP device (Sony W995) I'm still using apart form another android device.

Is your development available somewhere ?

Thanks.



来源:https://stackoverflow.com/questions/11084766/mp3-streaming-using-player-switching

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!