app/src/main/java/org/sil/hearthis/RecordActivity.java
// Todo: disable when no recording exists.
disable when no recording exists.
disable when no recording exists .
void playButtonClicked() {
		stopPlaying();
		playButton.setPlaying(true);
		playButtonPlayer = new MediaPlayer();
		playButtonPlayer.setOnCompletionListener(this);
		stopMonitoring();
		try {
			File file = new File(_recordingFilePath);
			playButtonPlayer.setDataSource(file.getAbsolutePath());
			playButtonPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
			playButtonPlayer.prepare();
			playButtonPlayer.start();
		} catch (Exception e) {
			e.printStackTrace();
		}		
	}
void playButtonClicked ( ) { stopPlaying ( ) ; playButton . setPlaying ( true ) ; playButtonPlayer = new MediaPlayer ( ) ; playButtonPlayer . setOnCompletionListener ( this ) ; stopMonitoring ( ) ; try { File file = new File ( _recordingFilePath ) ; playButtonPlayer . setDataSource ( file . getAbsolutePath ( ) ) ; playButtonPlayer . setAudioStreamType ( AudioManager . STREAM_MUSIC ) ; playButtonPlayer . prepare ( ) ; playButtonPlayer . start ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } }
Todo: disable when no recording exists.
Todo : disable when no recording exists .
// Todo:  file name and location based on book, chapter, segment //			AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); //			int maxVol = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC); //			Log.d("Player", "current volume is " + audioManager.getStreamVolume(AudioManager.STREAM_MUSIC) //					+ " of max " + maxVol); //			audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, maxVol, 0);