fix: prevent audio processing when no audio source is loaded

This commit is contained in:
Tomáš Mládek 2025-07-27 21:31:35 +02:00
parent fca971e13c
commit 610d8350af

View file

@ -31,10 +31,10 @@ export default defineComponent({
// Use the global audio loading queue to throttle concurrent loads
const preloadAudio = (src: string) => {
console.debug(`[AUDIOAREA] Queueing audio for preload: ${src}`);
// Set audioSrc to empty initially
audioSrc.value = "";
// Queue the audio for loading through our global service
// Our improved AudioLoader will cache and deduplicate requests
queueAudioForLoading(src)
@ -60,6 +60,8 @@ export default defineComponent({
const vol_b = 1 - vol_x;
const onBBoxChange = () => {
if (!audioSrc.value) return;
const x = props.bbox.x + props.bbox.w / 2;
const y = props.bbox.y + props.bbox.h / 2;
const distance = Math.sqrt(