Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternatives to rotating buffers into Players in J2ME?

Due to (quite annoying) limitations on many J2ME phones, audio files cannot be played until they are fully downloaded. So, in order to play live streams, I'm forced to download chunks at a time, and construct ByteArrayInputStreams, which I then feed to Players.

This works well, except that there's an annoying gap of about 1/4 of a second every time a stream ends and a new one is needed. Is there any way to solve this problem, or the problem above?

like image 341
zildjohn01 Avatar asked Apr 24 '09 23:04

zildjohn01


1 Answers

The only good way to play long (3 minutes and more) tracks with J2ME JSR135, moderately reliably, on the largest number of handsets out there, is to use a "file://" url when you create the player, or to have the inputstream actually come from a FileConnection.

recent blackberry phones can use a ByteArrayInputstream only when they have a large java heap memory available.

a lot of phones running on the Symbian operating system will allow you to put files in a private area for the J2ME application while still being able to play tracks in the same location.

like image 61
michael aubert Avatar answered Oct 16 '22 02:10

michael aubert