74.10 Implementing the playAudio() method
The playAudio() method will simply create a new MediaPlayer instance, assign the audio file located on the SD card as the data source and then prepare and start the playback:
public void playAudio (View view) throws IOException
{
binding.playButton.setEnabled(false);
binding.recordButton.setEnabled(false);
binding.stopButton.setEnabled(true);
mediaPlayer = new MediaPlayer();
mediaPlayer.setDataSource(audioFilePath);
mediaPlayer.prepare();
mediaPlayer.start();
}