0 Replies - 6262 Views - Last Post: 19 September 2011 - 12:15 PM

#1 Ishraq26  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 17-August 11

j2me Player, play mp3 files one after the other.

Posted 19 September 2011 - 12:15 PM

hi, i am unable to play an mp3 file one after the other, when 1 file finishes playing the other file needs to start. i am only able to start playing 1 file, when i put code to start the next file it just does nothing. for some reasons i cannot use thread.sleep() for the duration of file. Is there any other way to do this? Thank you! :)

//this is the basic code..

playq(String fname){
pl =  Manager.createPlayer(stream,"audio/mpeg");
pl.realize();

pl.prefetch();
 
pl.start();

// what should i use here?? pls i don't want to use thread.sleep..
playagain(fname);
}
void playagain(String fname){
        try {
          
    pl.stop();
    pl.deallocate();
   pl.close();
   
} catch (Exception ex) {}
 //change file name and stream and..
        playq(mp3f);
    }


Is This A Good Question/Topic? 0
  • +

Page 1 of 1