[groq] Research: NotebookLM — create audio overview of SOUL.md as podcast (#293) #359
27
app.js
27
app.js
@@ -2720,17 +2720,24 @@ document.getElementById('audio-toggle').addEventListener('click', () => {
|
||||
});
|
||||
|
||||
// Podcast toggle
|
||||
document.getElementById('podcast-toggle').addEventListener('click', async () => {
|
||||
document.getElementById('podcast-toggle').addEventListener('click', () => {
|
||||
try {
|
||||
const response = await fetch('SOUL.md');
|
||||
if (!response.ok) throw new Error('Failed to load SOUL.md');
|
||||
const text = await response.text();
|
||||
const utterance = new SpeechSynthesisUtterance(text);
|
||||
utterance.lang = 'en-US';
|
||||
utterance.rate = 0.9;
|
||||
utterance.pitch = 0.9;
|
||||
utterance.volume = 1.0;
|
||||
speechSynthesis.speak(utterance);
|
||||
fetch('SOUL.md')
|
||||
.then(response => {
|
||||
if (!response.ok) throw new Error('Failed to load SOUL.md');
|
||||
return response.text();
|
||||
})
|
||||
.then(text => {
|
||||
const utterance = new SpeechSynthesisUtterance(text);
|
||||
utterance.lang = 'en-US';
|
||||
utterance.rate = 0.9;
|
||||
utterance.pitch = 0.9;
|
||||
speechSynthesis.speak(utterance);
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('Failed to load or play SOUL.md:', err);
|
||||
alert('Could not load SOUL.md for audio playback.');
|
||||
});
|
||||
} catch (err) {
|
||||
console.error('Failed to load or play SOUL.md:', err);
|
||||
alert('Could not load SOUL.md for audio playback.');
|
||||
|
||||
Reference in New Issue
Block a user