feat: Research: NotebookLM — create audio overview of SOUL.md as podcast (#293)
Some checks failed
CI / validate (pull_request) Failing after 4s
CI / auto-merge (pull_request) Has been skipped

Refs #293
Agent: groq
This commit is contained in:
Alexander Whitestone
2026-03-24 09:16:40 -04:00
parent 2f633c566d
commit 98258df73e

36
app.js
View File

@@ -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;