@@ -231,17 +231,16 @@ final class FlowSessionManager: ObservableObject {
231231 return
232232 }
233233
234- // Transition away from .listening — the audio callback gate immediately stops
235- // buffering. Engine keeps running for subsequent dictation segments.
234+ // Gate closed: transition away from .listening so the audio callback stops buffering.
235+ // Engine keeps running for subsequent dictation segments.
236236 transition ( to: . transcribing)
237237 SharedDataBridge . shared. sessionState = " transcribing "
238238 if #available( iOS 16 . 1 , * ) {
239239 await updateLiveActivity ( phase: " transcribing " , transcript: " " )
240240 }
241241
242- // Drain: allow any DispatchQueue.main callbacks already queued before the state
243- // change to flush (they will see sessionPhase != .listening and discard their data)
244- try ? await Task . sleep ( nanoseconds: 100_000_000 ) // 100ms
242+ // Brief drain to let any already-queued DispatchQueue.main.async audio callbacks flush.
243+ try ? await Task . sleep ( nanoseconds: 50_000_000 ) // 50ms
245244
246245 let audio = audioBuffer
247246 audioBuffer = Data ( )
@@ -278,11 +277,6 @@ final class FlowSessionManager: ObservableObject {
278277 // MARK: - Transcription
279278
280279 private func transcribeAndDeliver( _ audio: Data) async {
281- transition ( to: . transcribing)
282- SharedDataBridge . shared. sessionState = " transcribing "
283- if #available( iOS 16 . 1 , * ) {
284- await updateLiveActivity ( phase: " transcribing " , transcript: " " )
285- }
286280 logger. info ( " Transcribing \( audio. count) bytes " )
287281
288282 do {
0 commit comments