diff --git a/frontend/src/components/Preload/Preload.jsx b/frontend/src/components/Preload/Preload.jsx index 5241469f9..9e50b8da0 100644 --- a/frontend/src/components/Preload/Preload.jsx +++ b/frontend/src/components/Preload/Preload.jsx @@ -41,6 +41,11 @@ const Preload = ({ sections, playMethod, duration, preloadMessage, pageTitle, on } return; } + + // Clear buffers if this is the first section + if (index === 0) { + webAudio.clearBuffers(); + } // Load sections in buffer return webAudio.loadBuffer(section.id, section.url, () => { @@ -66,8 +71,6 @@ const Preload = ({ sections, playMethod, duration, preloadMessage, pageTitle, on } preloadResources(); - // on destroy, clean up buffers - return webAudio.clearBuffers(); }, [sections, playMethod, onNext]); return (