Bỏ qua đến nội dung

tts_for_linux use Kokoro-FastAPI

Chờ xử lý #anki #addon #tts #for #linux #use #kokoro
https://github.com/nanhualyq/tts_for_linux/issues
28/7/2025

Cách tải addon tts_for_linux use Kokoro-FastAPI

Bạn có thể tải addon bằng một trong hai cách sau:

Click nút Copy bên dưới để copy code vào clipboard

733203228

Sau đó mở Anki → Tools → Add-ons → Get Add-ons → Dán code → OK

Mở trang addon trên AnkiWeb và tìm mã code ở cuối trang

Mở trên AnkiWeb

Cuộn xuống cuối trang AnkiWeb, tìm dòng có mã code 733203228 và copy

Mô tả chi tiết

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 生成的本地音频

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

扩展配置

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

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

AwesomeTTS gTTS

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

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

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


Liên kết hỗ trợ