Mp3 Streaming Using Player Switching

2019-07-28 02:38发布

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条回答
看我几分像从前
2楼-- · 2019-07-28 03:16

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.

查看更多
登录 后发表回答