Skip to content

Commit

Permalink
Merge pull request #5 from newpepsi/master
Browse files Browse the repository at this point in the history
修复无法多次录制的bug
  • Loading branch information
zhaolewei authored Jan 25, 2019
2 parents 50d05d0 + b2e48d5 commit 3cbb509
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,10 @@ private class AudioRecordThread extends Thread {
Logger.d(TAG, "record buffer size = %s", bufferSize);
audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC, currentConfig.getSampleRate(),
currentConfig.getChannelConfig(), currentConfig.getEncodingConfig(), bufferSize);
if (currentConfig.getFormat() == RecordConfig.RecordFormat.MP3 && mp3EncodeThread == null) {
initMp3EncoderThread(bufferSize);
if (currentConfig.getFormat() == RecordConfig.RecordFormat.MP3) {
if (mp3EncodeThread == null) {
initMp3EncoderThread(bufferSize);
}
}
}

Expand Down Expand Up @@ -311,6 +313,7 @@ private void startMp3Recorder() {
@Override
public void onFinish() {
notifyFinish();
mp3EncodeThread = null;
}
});
} else {
Expand Down

0 comments on commit 3cbb509

Please sign in to comment.