diff --git a/nginx/html/index.html b/nginx/html/index.html index 3e94eed..5b9cb28 100644 --- a/nginx/html/index.html +++ b/nginx/html/index.html @@ -98,7 +98,13 @@ // Pre-fetch & decode once (lazy: only on first click) async function initAudio() { ctx = new (window.AudioContext || window.webkitAudioContext)() - const res = await fetch(AUDIO_FILE) + const res = await fetch(AUDIO_FILE, { + method: "GET", + mode: "cors", // nur nötig, wenn Domain ≠ Seite + headers: { + "X-API-Key": API_KEY, + }, + }) const array = await res.arrayBuffer() buffer = await ctx.decodeAudioData(array) }