GeeCON Prague 2014*
The moose likes Java Micro Edition and the fly likes Problems with Player -- no sounds. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Problems with Player -- no sounds." Watch "Problems with Player -- no sounds." New topic
Author

Problems with Player -- no sounds.

Michael Tan
Greenhorn

Joined: Jul 07, 2009
Posts: 6


this code does not play the mp3 file.... what should i do to make it play?

in addition, i need to do some decryption on the bytes in the mp3 file, so i did this



and i get the error "javax.microedition.media.MediaException: Prefetch error: -5"

wat should i do to fix these problems?
Peter Miklosko
Ranch Hand

Joined: May 26, 2009
Posts: 76
I used this code sometime ago, it may not be most pretty and efficient but it did its job
Michael Tan
Greenhorn

Joined: Jul 07, 2009
Posts: 6
Peter Miklosko wrote:I used this code sometime ago, it may not be most pretty and efficient but it did its job


hi, thanks for the help... however, i get the Exception "java.lang.IllegalArgumentException: InputStream is null.", when putting in the path as "file:///test.mp3". test.mp3 exists in the mass memory of the phone, and can be played using the built in player.
Peter Miklosko
Ranch Hand

Joined: May 26, 2009
Posts: 76
Michael Tan wrote:
hi, thanks for the help... however, i get the Exception "java.lang.IllegalArgumentException: InputStream is null.", when putting in the path as "file:///test.mp3". test.mp3 exists in the mass memory of the phone, and can be played using the built in player.

This is because my code was reading resources from inside JAR. You need to edit that line and provide stream representation of chosen file
 
GeeCON Prague 2014
 
subject: Problems with Player -- no sounds.