Merge f9ebbe2f90
into 8609e5fae5
This commit is contained in:
commit
39a7b7f60f
|
@ -365,7 +365,6 @@ public class MicrophoneHelper implements AudioDataProducer {
|
|||
* Stops the AudioRecord object from reading data from the microphone.
|
||||
*/
|
||||
public void stopMicrophoneWithoutCleanup() {
|
||||
Preconditions.checkNotNull(audioRecord);
|
||||
if (!recording) {
|
||||
return;
|
||||
}
|
||||
|
@ -379,6 +378,7 @@ public class MicrophoneHelper implements AudioDataProducer {
|
|||
Log.e(TAG, "Exception: ", ie);
|
||||
}
|
||||
|
||||
Preconditions.checkNotNull(audioRecord);
|
||||
audioRecord.stop();
|
||||
if (audioRecord.getRecordingState() != AudioRecord.RECORDSTATE_STOPPED) {
|
||||
Log.e(TAG, "AudioRecord.stop() didn't run properly.");
|
||||
|
@ -389,11 +389,12 @@ public class MicrophoneHelper implements AudioDataProducer {
|
|||
* Releases the AudioRecord object when there is no ongoing recording.
|
||||
*/
|
||||
public void cleanup() {
|
||||
Preconditions.checkNotNull(audioRecord);
|
||||
if (recording) {
|
||||
return;
|
||||
}
|
||||
audioRecord.release();
|
||||
if (audioRecord != null) {
|
||||
audioRecord.release();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue
Block a user