[RFE] Add config setting to let user set default TTS voice per language (locale)

I’d like to suggest a new configuration setting. Specifically, I’d like to suggest that it be possible for the user to configure per-language (more precisely, per-locale) default TTS voices.

Why this setting?

Suppose that you are learning French but are dissatisfied with the default TTS voice.[1] You have found a better TTS engine on the Play Store and installed it; this engine offers two voices, Jean and Odette. You would like to use Odette for any French TTS tags without explicit voice overrides; that is, any tts tag à la {{tts fr_FR:exemple}} should be read using this voice. Tags explicitly setting voices should not be affected, except as a fallback when none of the specified voices are found, in which case the user-set default should be used again.

The advantage of having a dedicated setting for this is that you do not have to fiddle with cards (time-consuming and out of reach for non-technical users) to experiment with different voices. If you did not find Odette to your liking and would like to try Jean instead, you could simply adjust the setting.

Why language-/locale-specific?

Suppose you are learning both French and Italian. You may be dissatisfied the default French voice (Odette sounds much nicer), but the default Italian voice is fine, and even if it did not you would likely not want to use one of the French voices for Italian TTS.

Final words

Thanks for your consideration!

Footnotes:

  1. This is “based on a true story”.

On my device, I can go to the Text-to-speech output settings → tap the arrow button → tap Install voice data → tap the language I want and change the voice.

AnkiDroid immediately reflects that.

Thanks for the reply.

Unfortunately, this does not work for me. With no voice specifically selected, tts tags default to the Google TTS voice for the given locale, not the TTS engine I got from the Play Store and its voices for the language I’m learning.

(P.S. what is yellow and equivalent to the axiom of choice?)

(Zorn’s lemon, right. You’re the second one to notice my username’s reference.)

Hi, totally feasible, but we want to follow upstream’s TTS code here and I’d rather not deviate.

Is this code AnkiDroid-specific, or could this change be included in the desktop client as well?

I think that making AnkiDroid use the “preferred” tts engine would solve this.

The French dictionary app by Livio, for example, successfully uses the non-google tts engine that I tested yesterday while AnkiDroid used the default Google tts engine.

I don’t know whether this will fix OP’s issue, but 100% agreed. We’ll look into it:

Thank you, David!

Two points:

  1. I would very much be in favor of this change also being made in the desktop client, if possible. (I suggested it for AnkiDroid because I typically use that for studying and the desktop client for note management.)
  2. Yes, using the default engine should help. The default engine I set on my phone doesn’t support all languages, though. Would it be feasible to check if it supports a given and fall back to Google’s if not?
  3. On Zorn’s earlier point: I still think that the configuration setting I suggested would be useful to have; a user who has configured (say) Jean as the default voice for French TTS systemwide might still want Odette as the default voice for French TTS in Anki.

If a user wants this level of control, they can still edit the template.

There are always use cases that we can come up with, but we have to consider whether an additional option would be used by enough people to justify the added complexity to the average user.

Cheers!

Could you cross-link this in a post in the main Anki “Suggestions” category?

If there’s more discussion required about whether an upstream change is needed, I can move this thread there (and that’s probably better than opening a new thread). But if you’re already sure that should happen, you can open an issue in GitHub.

@Danika_Dakika let’s move the thread, I’ve already split out and improved engine-based voice ordering in AnkiDroid. (@KegOVitalin , will release this in 2.26.0alpha6, maybe 2.25.4)

The ‘default voice’ feature request - I’d rather see it implemented, or rejected on the Anki side, rather than breaking ecosystem compatibility. AnkiDroid has a decent place for it to go; Anki Desktop doesn’t yet have a ‘tts-voices’ screen.

Note: I’m neutral/light no on the feature until it has an area in the app where it obviously belongs: more features means more complexity, and that’s a high bar to reach.