Skip to content

Commit 0e8ce22

Browse files
ZhaoChaoqunclaude
andcommitted
Fix Streaming Paraformer state leakage between sessions
Reset stream state after getting final result to prevent residual data from appearing at the beginning of the next recording session. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 0d0fa92 commit 0e8ce22

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Sources/RecordingManager.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,9 @@ class RecordingManager {
416416
// 获取最终结果
417417
let text = recognizer.getResult()
418418

419+
// 重置流状态,清空残留数据
420+
recognizer.reset()
421+
419422
DispatchQueue.main.async {
420423
var finalText: String? = nil
421424
if !text.isEmpty {

0 commit comments

Comments
 (0)