diff --git a/src/std.js b/src/std.js index 2a81d0e..d23b9da 100644 --- a/src/std.js +++ b/src/std.js @@ -1,5 +1,31 @@ -window.spagda = function spagda(name) { +function spag(name) { + return `https://spag.cc/${name}`; +} + +function spagda(name) { samples({ - [name]: `https://spag.cc/${name}`, + [name]: spag(name), }); -}; +} + +function speechda( + wordsArg = '', + // default to PC music + locale = 'en-GB', + gender = 'f', +) { + const words = wordsArg + .replaceAll(' ', ',') + .split(',') + .map((word) => word.trim()) + .filter((word) => word.length > 0); + + if (words.length === 0) { + return; + } + samples(`shabda/speech/${locale}/${gender}:${words.join(',')}`); +} + +window.speechda = speechda; +window.spagda = spagda; +window.spag = spag;