AnkiWeb
- Rating
- 0 (π 0 Β· π 0)
- Updated
- 2025-11-29
- Anki versions
- 2.1.1~
- Description language
- en
AnkiWeb addon 42281744
Plays audio from a local dictionary, then online gTTS, then offline Piper TTS, with cycling, smart caching, and failover.
Open on AnkiWeb GitHub Ask about alternatives
active
| Min Anki | Max Anki | Updated |
|---|---|---|
| 2.1.1 | + | 2025-11-29 |
Loadingβ¦
Registers a Linux TTS player for native Anki {{tts}} tags, using Azure/Edge Neural or gTTS synthesis with espeak-ng fallback and local caching.
Pronounces selected text or a fallback field via Alt+C using Azure/Edge neural voices, automatic language detection, and local audio caching.
Synthesizes Japanese audio at review time via a local VOICEVOX server, with central preset routing, text cleanup rules, caching, and optional audio export.
Plays locally generated Kokoro TTS audio through Kokoro-FastAPI, configured with a URL and language-voice mappings, reducing Linux cloud TTS latency and network/profile restart issues.
Provides third-party text-to-speech support for Anki 2.1.20+, letting card templates read fields aloud via documented TTS template syntax.
Automatically reads card content aloud during reviews via neural text-to-speech, with offline system fallback, audio caching, text cleaning, and configurable speed, question, and answer settings.
A powerful Anki audio add-on with a 3-tier playback system: prioritizes your local audio dictionary, falls back to online gTTS, and finally to offline Piper TTS.
Attribution & Source
This add-on is a modified fork of the official gTTS Player developed by Ankitects Pty Ltd.
- Original Project: Source Code | AnkiWeb (391644525)
- This Enhanced Version: Source Code | AnkiWeb (42281744)
Licensed under the GNU AGPL, version 3 or later.
This enhanced version uses a 3-tier system for audio playback: a local high-fidelity audio dictionary, Google's online TTS service, and a local Piper TTS engine for a complete offline fallback.
The primary goal of this enhancement is to create a self-sufficient study environment. Whether you are on the go with limited mobile data or wish to disconnect completely for a focused study session, this add-on ensures your audio cards work flawlessly. By leveraging a local TTS engine, it saves bandwidth, works entirely offline, and removes dependency on an active internet connection.
gTTS and Piper to compare synthesized voices.gTTS and Piper as the primary TTS engine via the Anki Tools menu.The add-on intercepts Anki's default TTS requests and processes them with the following priority:
Check Audio Dictionary:
.mp3 file in your configured local audio dictionary path.Attempt Primary TTS (or Cycle):
tts_cycle_enabled is true, it alternates between gTTS and Piper on each click.gTTS or Piper).Cross-Engine Failover:
Choose one of the following methods:
Option A: Install via AnkiWeb (Recommended)
42281744Option B: Manual Installation (Advanced)
addons21 directory.For offline functionality, you must set up the external TTS engine:
config.ini, etc.).Important: Please configure this add-on via the Anki interface: Tools -> Add-ons -> Select this add-on -> Config.
Anki manages user preferences using a separate
meta.jsonfile. Manually editingconfig.jsonin the file system is not recommended, as your changes may be ignored or overwritten by Anki's internal settings management.
Immediate Effect: All configuration changes (including paths, timeouts, and cache settings) apply immediately after clicking "OK" in the configuration window. You do not need to restart Anki for these changes to take effect, as the add-on re-reads the configuration before playing each audio file.
The default configuration (in config.json) looks like this:
{
"tts_engine": "gTTS",
"persistent_cache_enabled": true,
"persistent_cache_path": "",
"audio_dictionary_enabled": true,
"audio_dictionary_path": "D:/AudioDictionaries",
"audio_dictionary_lang_map": {
"de_DE": "German",
"en_US": "English",
"en_GB": "English"
},
"audio_dictionary_exclusions": [
"BadSpeakerName"
],
"audio_dictionary_cycle_enabled": true,
"audio_dictionary_cycle_limit": 3,
"tts_cycle_enabled": true,
"gtts_enabled": true,
"gtts_timeout_sec": 5,
"gtts_cache_enabled": true,
"piper_enabled": true,
"piper_python_path": "C:/Python/Python312/python.exe",
"piper_script_path": "D:/apps/piper-tts/piper_tts.py",
"piper_cache_enabled": true
}
| Key | Type | Description |
|---|---|---|
| General Settings | ||
tts_engine |
String | The default TTS engine: "gTTS" or "Piper". Can also be toggled via the Tools menu. |
persistent_cache_enabled |
Boolean | (Optional, Default: true) If true, saves TTS files to a permanent folder. If false, uses Anki's temp folder (deleted on exit). |
persistent_cache_path |
String | (Optional, Default: "") A custom path for the cache. If empty, defaults to user_cache inside the add-on folder. |
tts_cycle_enabled |
Boolean | (Optional, Default: false) If true, repeated clicks on a TTS field will alternate between gTTS and Piper. |
| Audio Dictionary Settings | ||
audio_dictionary_enabled |
Boolean | (Optional, Default: false) Master switch to enable or disable the local audio dictionary feature. |
audio_dictionary_path |
String | (Optional, Default: "") Required if enabled. Absolute path to the root folder of your audio dictionary (e.g., D:/Forvo). |
audio_dictionary_lang_map |
Object | (Optional, Default: {}) Maps Anki language codes to your custom folder names (e.g., "de_DE": "German"). If omitted, it defaults to two-letter codes (e.g., de, en). |
audio_dictionary_exclusions |
Array | (Optional, Default: []) A list of strings. If any string appears in an audio file's path, it will be skipped. Useful for blacklisting speakers. |
audio_dictionary_cycle_enabled |
Boolean | (Optional, Default: false) If true, repeated clicks will cycle through different recordings of the same word. |
audio_dictionary_cycle_limit |
Integer | (Optional, Default: 2) The maximum number of recordings to cycle through for a single word. |
| gTTS Engine Settings | ||
gtts_enabled |
Boolean | (Optional, Default: true) Master switch to enable or disable the gTTS engine entirely. |
gtts_timeout_sec |
Integer | (Optional, Default: 5) Seconds to wait for Google's API before failing over to Piper. |
gtts_cache_enabled |
Boolean | (Optional, Default: true) If false, forces a fresh download every time. <br>β οΈ Warning: Disabling this may lead to a temporary IP ban from Google. |
| Piper TTS Engine Settings | ||
piper_enabled |
Boolean | (Optional, Default: true) Master switch to enable or disable the Piper TTS engine entirely. |
piper_python_path |
String | (Optional, Default: "") Required if enabled. Full path to your Python executable (e.g., C:/Python/python.exe). |
piper_script_path |
String | (Optional, Default: "") Required if enabled. Full path to the piper_tts.py script. |
piper_cache_enabled |
Boolean | (Optional, Default: true) If false, regenerates audio every time (high CPU usage). |
To enable audio on your cards, you need to add the standard Anki TTS tag to your Card Templates (Front or Back).
Insert the following code into your template where you want the audio to play:
{{tts en_GB voices=gTTS:Front}}
en_GB: The language code. Change this to match your target language (e.g., en_US, de_DE, ru_RU, uk_UA).voices=gTTS: Important: Do not change this parameter. This add-on specifically intercepts requests made to gTTS to enable the caching and offline fallback features.Front: The name of the field you want to be read aloud.Below are examples of how to configure the tag for different languages, based on common usage patterns:
{{tts en_GB voices=gTTS:EnglishWord}}{{tts en_US voices=gTTS:EnglishWord}}{{tts de_DE voices=gTTS:GermanWord}}{{tts ru_RU voices=gTTS:RussianhWord}}{{tts uk_UA voices=gTTS:UkrainianhWord}}For a comprehensive collection of real-world templates demonstrating proper integration, please refer to the Kardenwort Anki Templates project.
This project provides extensive examples of how to structure cards and tag fields for various languages within a production-ready environment.
{{tts...}}) without needing to edit card templates.This project is part of the Kardenwort environment, designed to create a focused and efficient learning ecosystem.