Code example for MediaPlayer

Methods: getDuration

0
		notifyFinish(); 
		player.release();
	} 
 
	public int getDuration() { 
		return player.getDuration();
	} 
 
	public void prepare() throws SoundException { 
		if (player != null) return;
		 
		player = new MediaPlayer();
		try { 
			sourceProvider.setDataSource(player, filePath);	
			player.prepare();
		} catch (IOException e) {
			throw new SoundException("Could not prepare sound " + filePath, e);
			 
		} 
	}