diff src/site.js @ 31:1e7d855afde3

voices
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 03 Aug 2025 17:05:38 -0600
parents 505185272dd7
children 0fb3488a017d
line wrap: on
line diff
--- a/src/site.js	Sun Aug 03 12:25:01 2025 -0600
+++ b/src/site.js	Sun Aug 03 17:05:38 2025 -0600
@@ -124,7 +124,7 @@
 
 let mdDiv = document.createElement('div');
 
-function handleMarkdown(lang) {
+function handleMarkdown(lang,voice) {
 	let converter = window.markdownit({html: true});
 	let divs = document.querySelectorAll('[markdown]');
 	for( let div of divs ) {
@@ -138,7 +138,7 @@
 				rt.remove();
 			}
 			//console.log(mdDiv.textContent);
-			text += `\n<p><audio controls preload=none src="/tts.mp3?lang=${lang}&text=${encodeURIComponent(mdDiv.textContent)}"></audio></p>\n`;
+			text += `\n<p><audio controls preload=none src="/tts.mp3?lang=${lang}&voice=${voice}&text=${encodeURIComponent(mdDiv.textContent)}"></audio></p>\n`;
 		}
 		div.innerHTML = text;
 		div.removeAttribute('markdown');