tts_for_linux use Kokoro-FastAPI

AnkiWeb addon 733203228

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.
AI-generated summary; may contain mistakes.

sync-integrationbugfix-workaroundfork-or-reupload

Open on AnkiWeb GitHub Ask about alternatives

AnkiWeb

Rating
0 (👍 0 · 👎 0)
Updated
2025-07-28
Anki versions
25.02.7~
Description language
zh

Maintenance

stale

  • Last update or commit was 430 days before the snapshot (2025-07-28).

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
2.1.125.02.7+2025-07-28
History across monthly snapshots

Loading…

Similar addons

README

This is an Anki addon.

Function: It allows TTS playback of local audio generated by Kokoro.

1. Kokoro-FastAPI Service: https://github.com/remsky/Kokoro-FastAPI

2. Addon Configuration:

  • The URL of Kokoro-FastAPI.
  • Specify the required languages and their corresponding voice.

Addendum

Unlike other operating systems that have built-in TTS engines, Linux can only achieve TTS by downloading audio files from cloud services through addons, such as:

  • AwesomeTTS
  • gTTS

I primarily study on Linux and frequently encounter issues with these solutions, including:

  • Latency
  • Inability to pronunciation after network interruption (requires restarting Anki)
  • Inability to pronunciation after switching profile (requires restarting Anki)

This has often been a painful experience. Recently, after encountering Kokoro, I explored this solution. It's essentially a modification of gTTS, replacing its original audio download process from Google Translate with local service requests to Kokoro-FastAPI. This resolves the issues of high latency and network interruptions, and incidentally, also solves the profile-switching problem.


这是一个anki扩展

作用是让 tts 播放 Kokoro 生成的本地音频

  1. 准备好 Kokoro-FastAPI 服务 https://github.com/remsky/Kokoro-FastAPI

  2. 扩展配置

    • 填入 Kokoro-FastAPI 的 url
    • 需要的语言及其对应的voice

补充

Linux不像其他操作系统有内置的TTS引擎,所以只能通过扩展从云服务下载音频文件来实现TTS,比如:

  • AwesomeTTS
  • gTTS

我平时主要在Linux上学习,使用这些的方案,经常会碰到的问题是:

  • 延迟
  • 网络中断后再恢复不能发音(需要重启anki)
  • 切换用户后不能发音(需要重启anki)

所以常常是苦不堪言,最近接触到 Kokoro 后,才探索出这个方案,其实就是基于 gTTS 修改,将其原来从 Google Translate 下载音频的部分换成从 Kokoro-FastAPI 的本地服务,解决了高延迟和网络中断的问题,顺便把切换用户的问题也解决了。