@榮豪 蔡 If you want to stop recognition before the end of the conversation you should call stopContinuousRecognitionAsync() but it would not capture the entire conversation.
If you would like to capture only one sentence at a time you should use recognizeOnceAsync() to capture sentences only till the silence after completing the sentence.
In this example the file is written during the recognizing and recognized events so based on audio, stop recognition is only called after the end of session or if the end of stream is reached.
If an answer is helpful, please click on or upvote
which might help other community members reading this thread.