From e1e507bbc27bf72e19478fedf3648b41d2f4f8ea Mon Sep 17 00:00:00 2001 From: Matej Plavevski Date: Sat, 25 Nov 2023 14:16:27 +0100 Subject: [PATCH] One console log, crashed the entire app --- src/lib/audio/ExtractAudioTracks.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/audio/ExtractAudioTracks.svelte b/src/lib/audio/ExtractAudioTracks.svelte index ef853c9..21348bf 100644 --- a/src/lib/audio/ExtractAudioTracks.svelte +++ b/src/lib/audio/ExtractAudioTracks.svelte @@ -74,7 +74,12 @@ offlineContext.oncomplete = function(renderedBuffer) { console.log(renderedBuffer) console.log(renderedBuffer.renderedBuffer.getChannelData(0)) - console.log(renderedBuffer.renderedBuffer.getChannelData(1)) + try { + console.log(renderedBuffer.renderedBuffer.getChannelData(1)) + } catch(e) { + console.log("Doesn't have a second channel!") + console.error(e.message) + } BUFFER_AUDIO_DATA = renderedBuffer.renderedBuffer.getChannelData(0) return renderedBuffer.renderedBuffer.getChannelData(0) };