RxAndroidAudio
RxAndroidAudio copied to clipboard
When mPlayer is not empty?
public MediaPlayer getMediaPlayer() { return mPlayer; }
What do you mean? If you didn't start a player, it will return null.
I have started the audio recording. like
mAudioRecorder = AudioRecorder.getInstance();
mAudioFile = new File(Utils.getTodayAudioDirectory() +
File.separator + System.nanoTime() + ".file.m4a");
Log.e("mAudioFile Path", mAudioFile.toString());
mAudioRecorder.prepareRecord(MediaRecorder.AudioSource.MIC,
MediaRecorder.OutputFormat.MPEG_4, MediaRecorder.AudioEncoder.AAC,
mAudioFile);
mAudioRecorder.startRecord();
Now I wanted to pause it
I tried like
mRxAudioPlayer.getMediaPlayer().pause();
But I am getting null
FATAL EXCEPTION: main Process: enact.employ.tracking, PID: 1017 java.lang.NullPointerException: Attempt to invoke virtual method 'void android.media.MediaPlayer.pause()' on a null object reference
I am testing on Marshmallow 6.0 device
Maybe an error happened, please debug it.
Error is your library doesn't support the audio recording pause and play feature.
I assumed that
mRxAudioPlayer.getMediaPlayer().pause();
will pause my audio recording but its not.
Wrong assumption. right?