Code example for MediaPlayer

Methods: setAudioStreamTypesetOnCompletionListenersetOnPreparedListenersetVolume

0
	 
	public SoundPlayer(final Context context) {
		 
		this.context = context;
		 
		mediaPlayer = new MediaPlayer();
		mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
		mediaPlayer.setVolume(1.0f, 1.0f);
		mediaPlayer.setOnPreparedListener(this);
		mediaPlayer.setOnCompletionListener(this);
	} 
	 
	// **************************************************************** 
	// Sound play methods 
	// **************************************************************** 
	 
	/** 
	 * Play the sound in path synchronized (only one sound at time) 
	 *  
	 * @param path 
Connect your IDE to all the code out there  Get Codota for Java