Skip to content

Commit

Permalink
去掉200ms延迟
Browse files Browse the repository at this point in the history
Change-Id: Ic53d5344d6ed2202971664dc5fb443776876449c
  • Loading branch information
SundoggyNew committed Jan 10, 2024
1 parent 812b59c commit d2e6bd3
Showing 1 changed file with 29 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -347,42 +347,36 @@ public void stop() {
private void stopInternal() {
recorderState = false;
Log.e(TAG, "turn recorderState : " + recorderState);
mReadHandler.postDelayed(new Runnable() {
@Override
public void run() {
Log.e(TAG, "mReadHandler.postDelayed 200 turn recorderState : " + recorderState);
if (audioRecord != null) {
audioRecord.stop();
}
executor.shutdown();
audioRecord = null;
pcmEncoder = null;
if (flvPacker != null) {
flvPacker.release();
flvPacker = null;
}
if (canceler != null) {
canceler.setEnabled(false);
canceler.release();
canceler = null;
}
if (control != null) {
control.setEnabled(false);
control.release();
control = null;
}
if (!VoiceChangerJNIBridge.isAvailable()) {
if (st != null) {
st.finish();
st.clearBuffer(0);
st = null;
}
} else {
VoiceChangerJNIBridge.destory();
}
// GvoiceJNIBridge.destory();
if (audioRecord != null) {
audioRecord.stop();
}
executor.shutdown();
audioRecord = null;
pcmEncoder = null;
if (flvPacker != null) {
flvPacker.release();
flvPacker = null;
}
if (canceler != null) {
canceler.setEnabled(false);
canceler.release();
canceler = null;
}
if (control != null) {
control.setEnabled(false);
control.release();
control = null;
}
if (!VoiceChangerJNIBridge.isAvailable()) {
if (st != null) {
st.finish();
st.clearBuffer(0);
st = null;
}
}, 200);
} else {
VoiceChangerJNIBridge.destory();
}
// GvoiceJNIBridge.destory();
}

public void release() {
Expand Down

0 comments on commit d2e6bd3

Please sign in to comment.