You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The buffer never stops growing since it's never reset (createResponse() isn't called in server_vad mode). As a result, appendInputAudio's performance degrades drastically as the buffer copy gets bigger and bigger.
The buffer never stops growing since it's never reset (createResponse() isn't called in server_vad mode). As a result, appendInputAudio's performance degrades drastically as the buffer copy gets bigger and bigger.
This fix seems to work.
appendInputAudio(arrayBuffer) {
if (arrayBuffer.byteLength > 0) {
this.realtime.send('input_audio_buffer.append', {
audio: RealtimeUtils.arrayBufferToBase64(arrayBuffer),
});
/////////// ADD THIS CODE
if (this.sessionConfig.turn_detection?.type !== 'server_vad') {
this.inputAudioBuffer = RealtimeUtils.mergeInt16Arrays(
this.inputAudioBuffer,
arrayBuffer,
);
}
/////////// END ADDED CODE
}
return true;
}
The text was updated successfully, but these errors were encountered: