or) {
                    processor.disconnect(); // Disconnect processor
                }
                isRecording = false;
                document.getElementById('record').textContent = 'Start Recording';
            }

            function recordStart() {
                recordAudio();
                isRecording = true;
                document.getElementById('record').textContent = 'Stop Recording';
            }

            function recordAudio() {
                navigator.mediaDevices.getUserM