/** Runs the thread. */ public void run() { try { music.play(); } catch (Exception e) { e.printStackTrace(); } }
/** Returns the song time. */ public String getTime() { int position = music.getPosition(); position /= 1000; int seconds = position / 60; int minutes = position / 60 / 60; String time = minutes + ":" + seconds; return time; }
/** Returns whether or not music is finished. */ public boolean isComplete() { return music.isComplete(); }
/** Stops the song. You cannot restart it afterwards. */ public void stopSong() { music.close(); }