Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with Player -- no sounds.

 
Michael Tan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used this code sometime ago, it may not be most pretty and efficient but it did its job
 
Michael Tan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic