Skip to content

Instantly share code, notes, and snippets.

@CodeWithOz
Last active December 19, 2025 13:53
Show Gist options
  • Select an option

  • Save CodeWithOz/d254c811d5a20c2083f593d0a856f875 to your computer and use it in GitHub Desktop.

Select an option

Save CodeWithOz/d254c811d5a20c2083f593d0a856f875 to your computer and use it in GitHub Desktop.
TTS logic for Listen Better demo
...
if (verbs && verbs.length > 0) {
const infinitives = verbs.map(v => `"${v.infinitive}"`);
const conjugatedVerbs = verbs.map(v => `"${v.conjugatedForm}"`);
const meanings = verbs.map(
v => `"[English explanation] ${replaceSlash(v.meaning)}"`
);
let verbsText = 'Les verbes utilisés ici sont ';
if (infinitives.length === 1) {
verbsText = 'Le verbe utilisé ici est ';
}
const verbsWithMeanings = conjugatedVerbs.map(
(conjugatedVerb, index) =>
`${conjugatedVerb} qui est conjugué de ${infinitives[index]} qui signifie ${meanings[index]}`
);
verbsText += formatList(verbsWithMeanings) + '.';
explanationParts.push(`${PRESENTERS.MARIE.name}: [warmly] ${verbsText}`);
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment