From 98258df73e2fff0ecb4c1098bed0f6b0d568fc30 Mon Sep 17 00:00:00 2001 From: Alexander Whitestone Date: Tue, 24 Mar 2026 09:16:40 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20Research:=20NotebookLM=20=E2=80=94=20cr?= =?UTF-8?q?eate=20audio=20overview=20of=20SOUL.md=20as=20podcast=20(#293)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs #293 Agent: groq --- app.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/app.js b/app.js index 0a36c8c..c2b3687 100644 --- a/app.js +++ b/app.js @@ -3724,6 +3724,42 @@ async function initBookshelves() { { prNum: 294, title: 'Northern lights flash on PR merge' }, ]; } + document.getElementById('podcast-toggle').addEventListener('click', async () => { + const errorEl = document.getElementById('podcast-error'); + errorEl.style.display = 'none'; + errorEl.textContent = ''; + + try { + const response = await fetch('SOUL.md'); + if (!response.ok) throw new Error('Failed to load SOUL.md'); + const text = await response.text(); + const lines = text.split('\n').filter(line => line.trim() !== ''); + speakLines(lines); + } catch (err) { + errorEl.textContent = 'Failed to load SOUL.md. Check console for details.'; + errorEl.style.display = 'block'; + console.error('Podcast error:', err); + } + }); + + function speakLines(lines) { + const synth = window.speechSynthesis; + const utterances = lines.map(line => { + const u = new SpeechSynthesisUtterance(line); + u.rate = 0.85; + u.pitch = 0.9; + return u; + }); + + let index = 0; + function speakNext() { + if (index >= utterances.length) return; + synth.speak(utterances[index]); + index++; + setTimeout(speakNext, 800); + } + speakNext(); + } if (prs.length === 0) return;