Built-in TTS html problems

It looks like you’re trying to use Conditional Replacement – but it’s not a flexible if-then-pattern-matching syntax. The only thing you can use with {{# or {{^ is the name of a field. It is only looking for “is there data in that field?” And the only answer are “yes” and “no.”

If you want to see a practical use of it, you can also take a look at the templates for the “Basic (optional reversed card)” notetype.

That’s not necessary though, right? Your multiple notetypes are working just fine?

I admit, there are derfinite advantages to being able to make an improvement in just one place, rather than on multiple notetypes. But I don’t think there’s a simple way to do this. And if you implement a complicated way that someone else suggests, you’re not going to be able to maintain it yourself. It seems like you’re just injecting instability into your collection unnecessarily.

If you’re dead-set on creating the one-notetype-to-rule-them-all, why not implement a simple solution, using bedrock Anki functionality? To do anything in this direction, you’ll need to have something that tells the tool/script/code which language to apply to this card, right?

Following the model of basic-optional-reversed – you could add a field to indicate a Note belongs to a language. One field, where you name the language? Nope. A field for each language you are studying – isRussian, isSpanish, isTurkish, isZulu, etc… Put something (anything) in the appropriate field for each note (see how fast sticky fields becomes your new best friend!). Then you can make your ultimate audio card template like this:

    {{tts ru-RU voices=Apple_Milena_(Enhanced):Front}}

    {{tts es-ES:Front}}

    {{tts tr-TR:Front}}

    {{tts zu-ZA:Front}}

– as many languages as you want. Readable, easily maintainable, and all contained on one template.