Question

So far all mp3 files I've tried work just fine, however, when trying a file I converted from Vorbis format it just wouldn't play.

No errors or anything, it's just that it doesn't make any sound.

Tried multiple converting apps.

Any way this can be solved?

InputStream iStreamSound = getClass().getResourceAsStream("file.mp3"); 
Player p = Manager.createPlayer(iStreamSound, "audio/mp3");
p.start(); 
Was it helpful?

Solution

Ogg is a container format. Vorbis is a compression mechanism/scheme for data meant to be stored in an ogg container. However, an ogg file can contain data compressed by means other than Vorbis. As such, I would first check the scheme used for the original file and then look at how that was converted for your mp3. I've found many j2me sound players to be fairly finicky, so it could just be that the underlying data structures aren't supported.

The most thorough way I can think of to convert it would be to take the .ogg first to a .wav file, then convert that to .mp3 if possible. Just make sure the wav->mp3 conversion uses a compression type that your handset supports.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top