.length > 0) {
                    isAudioPlaying = true;
                    const encodedAudio = encodeAudio(audioQueue, 24000, 16, 1);
                    audioQueue = [];
                    audio.src = URL.createObjectURL(encodedAudio);
                    audio.onended = function () {
                        isAudioPlaying = false;
                        playNextChunk();
                    }
                    audio.play();
                }
            }

            function playVideoStart() {
  