Skip to content

Commit

Permalink
speechda
Browse files Browse the repository at this point in the history
  • Loading branch information
TodePond committed Jan 25, 2025
1 parent 54584b0 commit f7f6d07
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions src/std.js
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit f7f6d07

Please sign in to comment.