Skip to content

Commit 51a422f

Browse files
committed
fix(voice): reset modelSpeaking in cleanup to unblock mic on restart
If the session closes while Gemini is mid-speech, cleanup() left state.modelSpeaking=true. The next startSession() would then drop all mic audio in sendAudioChunk() until a model turn eventually flipped the flag — effectively deaf until page reload.
1 parent 4c4962f commit 51a422f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

web/src/realtime/GeminiLiveVoiceSession.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ function cleanup() {
5959
}
6060
state.ws = null
6161
}
62+
// Always reset modelSpeaking so a restart doesn't begin with audio capture silenced
63+
state.modelSpeaking = false
6264
}
6365

6466
class GeminiLiveVoiceSessionImpl implements VoiceSession {

0 commit comments

Comments
 (0)