Skip to content

Instantly share code, notes, and snippets.

@dueka
Created April 29, 2023 15:15
Show Gist options
  • Save dueka/5437313cd597732595f4b80b521e4989 to your computer and use it in GitHub Desktop.
Save dueka/5437313cd597732595f4b80b521e4989 to your computer and use it in GitHub Desktop.
App.tsx
const leave = async () => {
setLeaveLoading(true);
try {
agoraEngineRef.current?.leaveChannel();
agoraEngineRef.current
?.getMediaEngine()
.unregisterAudioFrameObserver(iAudioFrameObserver);
console.log('stop recording ');
agoraEngineRef.current?.stopAudioRecording();
startTranscribe();
setRemoteUid(0);
setIsJoined(false);
console.log('you left the channel');
} catch (e) {
console.log(e);
}
setLeaveLoading(false);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment