File tree 3 files changed +5
-2
lines changed
3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change
Original file line number Diff line number Diff line change @@ -417,8 +417,8 @@ export class RealtimeClient extends RealtimeEventHandler {
417
417
*/
418
418
disconnect ( ) {
419
419
this . sessionCreated = false ;
420
- this . conversation . clear ( ) ;
421
420
this . realtime . isConnected ( ) && this . realtime . disconnect ( ) ;
421
+ this . conversation . clear ( ) ;
422
422
}
423
423
424
424
/**
Original file line number Diff line number Diff line change @@ -126,6 +126,9 @@ export class RealtimeConversation {
126
126
} ,
127
127
'input_audio_buffer.speech_stopped' : ( event , inputAudioBuffer ) => {
128
128
const { item_id, audio_end_ms } = event ;
129
+ if ( ! this . queuedSpeechItems [ item_id ] ) {
130
+ this . queuedSpeechItems [ item_id ] = { audio_start_ms : audio_end_ms } ;
131
+ }
129
132
const speech = this . queuedSpeechItems [ item_id ] ;
130
133
speech . audio_end_ms = audio_end_ms ;
131
134
if ( inputAudioBuffer ) {
You can’t perform that action at this time.
0 commit comments