From 1338f3b40ecaa90d7baad474e3c988969b4db68a Mon Sep 17 00:00:00 2001 From: Alexander Whitestone Date: Tue, 24 Mar 2026 08:57:43 -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 | 34 ++++++++++++++++++++++++---------- index.html | 2 +- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/app.js b/app.js index 35054bc..64a396d 100644 --- a/app.js +++ b/app.js @@ -2784,21 +2784,35 @@ document.getElementById('podcast-toggle').addEventListener('click', () => { return response.text(); }) .then(text => { - const utterance = new SpeechSynthesisUtterance(text); - utterance.lang = 'en-US'; - utterance.rate = 0.9; - utterance.pitch = 0.9; + const paragraphs = text.split('\n\n').filter(p => p.trim()); + + if (!paragraphs.length) { + throw new Error('No content found in SOUL.md'); + } + + let index = 0; + const speakNext = () => { + if (index >= paragraphs.length) return; + + const utterance = new SpeechSynthesisUtterance(paragraphs[index++]); + utterance.lang = 'en-US'; + utterance.rate = 0.9; + utterance.pitch = 1.1; + + utterance.onend = () => { + setTimeout(speakNext, 800); // 800ms pause between paragraphs + }; + + speechSynthesis.speak(utterance); + }; + btn.textContent = '⏹'; btn.classList.add('active'); - speechSynthesis.speak(utterance); - utterance.onend = () => { - btn.textContent = '🎧'; - btn.classList.remove('active'); - }; + speakNext(); }) .catch(err => { console.error('Podcast error:', err); - alert('Could not load SOUL.md for audio playback.'); + alert('Could not load SOUL.md. Check console for details.'); btn.textContent = '🎧'; }); } else { diff --git a/index.html b/index.html index 4b31701..cf07c36 100644 --- a/index.html +++ b/index.html @@ -36,7 +36,7 @@ -