利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.
Python ai-video-generatorcontent-creationffmpeginstagram-reelsllmpythonshort-videosubtitlestext-to-speechtiktokvideo-automationvideo-workflowworkflow-automationyoutube-shorts
fix(tts): harden Kokoro voice and audio handling
harry0703883ef2f8d43f
diff --git a/app/services/voice.py b/app/services/voice.pyindex 5d2efc6d..22c31401 100644--- a/app/services/voice.py+++ b/app/services/voice.py@@ -224,19 +224,32 @@ def get_chatterbox_voices() -> list[str]:KOKORO_DEFAULT_VOICE = "af_heart"-def get_kokoro_voices() -> list[str]:- """Return the Kokoro voices as ``kokoro:<name>`` entries.+def _normalize_kokoro_voices(entries) -> list[str]:+ """统一手工配置与服务端新旧格式,只接收真实 ID,避免把对象转成音色名。"""+ if isinstance(entries, str):+ entries = entries.split(",")+ if not isinstance(entries, list):+ return []+ result = []+ for entry in entries:+ name = entry.get("id") if isinstance(entry, dict) else entry+ if not isinstance(name, str):+ continue+ name = name.strip().removeprefix("kokoro:").strip()+ if name:+ value = f"kokoro:{name}"+ if value not in result:+ result.append(value)+ return result- Operators may pin the list via ``[kokoro] voices`` (a TOML array, or a- comma-separated string). When it is empty the server is asked:- Kokoro-FastAPI and compatible servers expose ``GET {base_url}/audio/voices``- → ``{"voices": [...]}``. If the server cannot be reached the dropdown falls- back to Kokoro's default voice so the UI stays usable.++def get_kokoro_voices(*, fallback: bool = True) -> list[str]:+ """手工音色优先,否则查询服务器;UI 可禁用默认值以识别断线并保留选择。++ 旧版服务器返回字符串列表,新版返回包含 id 的对象列表。失败时不在服务层+ 缓存会话状态;由 WebUI 保留上次成功目录,避免不同用户/端点互相污染。"""- voices = config.kokoro.get("voices", []) or []- if isinstance(voices, str):- voices = [v.strip() for v in voices.split(",") if v.strip()]- voices = [str(v).strip() for v in voices if str(v).strip()]+ voices = _normalize_kokoro_voices(config.kokoro.get("voices"))if not voices:base_url = (config.kokoro.get("base_url", "") or "").strip().rstrip("/")if base_url:@@ -251,17 +264,17 @@ def get_kokoro_voices() -> list[str]:if response.status_code == 200:data = response.json()listed = data.get("voices", []) if isinstance(data, dict) else data- voices = [str(v).strip() for v in (listed or []) if str(v).strip()]+ voices = _normalize_kokoro_voices(listed)+ if not voices:+ logger.warning("kokoro voice list contains no valid voice IDs")else:logger.warning(f"kokoro voices request failed with status {response.status_code}")except Exception as e:- logger.warning(f"kokoro voices unavailable at {base_url}: {str(e)}")- result = [v if v.startswith("kokoro:") else f"kokoro:{v}" for v in voices]- if not result:- result = [f"kokoro:{KOKORO_DEFAULT_VOICE}"]- return result+ # 不输出 URL/异常正文,避免自托管地址的查询参数或认证信息进入日志。+ logger.warning(f"kokoro voice list unavailable ({type(e).__name__})")+ return voices or ([f"kokoro:{KOKORO_DEFAULT_VOICE}"] if fallback else [])def get_fish_audio_voices() -> list[str]:@@ -1744,12 +1757,11 @@ def _openai_compatible_tts(# 1.0-centred multiplier, so it maps directly (clamped to the valid range)."speed": max(0.25, min(4.0, float(voice_rate or 1.0))),}- # voice_volume is accepted by the callers for parity with the other TTS- # providers but is intentionally not sent: the OpenAI /audio/speech contract- # has no volume field, so these servers ignore it. Adjust loudness via- # voice_rate (speed) or in post-processing instead.+ # OpenAI speech 协议没有音量字段;最终混音阶段应用 voice_volume。+ # speed 仅调节语速,不能作为音量参数使用。for i in range(3):+ temporary_audio = Nonetry:logger.info(f"start {provider} tts, voice: {voice}, try: {i + 1}")ensure_file_path_exists(voice_file)@@ -1761,16 +1773,28 @@ def _openai_compatible_tts()continue- with open(voice_file, "wb") as f:+ if not response.content:+ raise ValueError(f"{provider} returned empty audio")++ # 先写入同目录临时文件并真实解码,成功后才替换目标。失败不能破坏+ # 已有试听/配音;先关闭文件再解码和替换,兼容 Windows 文件占用规则。+ with tempfile.NamedTemporaryFile(+ dir=os.path.dirname(os.path.abspath(voice_file)),+ suffix=".mp3", delete=False,+ ) as f:+ temporary_audio = f.namef.write(response.content)- audio_clip = AudioFileClip(voice_file)+ audio_clip = AudioFileClip(temporary_audio)try:audio_duration = audio_clip.durationfinally:audio_clip.close()+ if not math.isfinite(audio_duration) or audio_duration <= 0:+ raise ValueError(f"{provider} returned an invalid audio duration")sub_maker = ensure_legacy_submaker_fields(SubMaker())+ os.replace(temporary_audio, voice_file)logger.success(f"{provider} tts succeeded: {voice_file}")return populate_legacy_submaker_with_full_text(sub_maker=sub_maker,@@ -1779,6 +1803,13 @@ def _openai_compatible_tts()except Exception as e:logger.error(f"{provider} tts failed: {str(e)}")+ finally:+ if temporary_audio and os.path.exists(temporary_audio):+ try:+ os.unlink(temporary_audio)+ except OSError as exc:+ # 清理失败仍保持 TTS 的失败返回约定,不用次要异常掩盖原始原因。+ logger.warning(f"could not remove temporary {provider} audio: {exc}")return None@@ -1855,6 +1886,11 @@ def kokoro_tts(if not text:logger.error("Kokoro TTS text is empty")return None+ # 纯标点/表情没有可发音文字;真实服务可能以 HTTP 200 返回空 MP3,+ # 提前终止可避免无效请求及 MoviePy 在解码空文件时的底层异常。+ if not any(character.isalnum() for character in text):+ logger.error("Kokoro TTS text contains no speakable characters")+ return Nonebase_url = (config.kokoro.get("base_url", "") or "").strip().rstrip("/")if not base_url:logger.error(diff --git a/test/services/test_kokoro.py b/test/services/test_kokoro.pynew file mode 100644index 00000000..f3a086a4--- /dev/null+++ b/test/services/test_kokoro.py@@ -0,0 +1,133 @@+"""Kokoro 协议兼容和共享音频传输回归,不依赖外部服务。"""++from types import SimpleNamespace+from unittest.mock import Mock++import pytest+import requests++from app.config import config+from app.services import voice+++def kokoro_config(monkeypatch):+ settings = {"base_url": "http://localhost:8880/v1/", "api_key": "test-key",+ "model_id": "kokoro", "voices": []}+ monkeypatch.setattr(config, "kokoro", settings)+ return settings++[email protected]("payload", [+ {"voices": ["af_heart", "zf_xiaobei"]},+ {"voices": [{"id": "af_heart", "name": "Heart"}, {"id": "zf_xiaobei"}]},+ ["af_heart", {"id": "zf_xiaobei"}],+])+def test_voice_list_supports_old_and_new_servers(monkeypatch, kokoro_config, payload):+ get = Mock(return_value=SimpleNamespace(status_code=200, json=lambda: payload))+ monkeypatch.setattr(voice.requests, "get", get)+ assert voice.get_kokoro_voices() == ["kokoro:af_heart", "kokoro:zf_xiaobei"]+ get.assert_called_once_with("http://localhost:8880/v1/audio/voices",+ headers={"Authorization": "Bearer test-key"}, timeout=5)++[email protected]("entries, expected", [+ ([" af_heart ", "kokoro:af_heart", {"id": " zf_xiaobei "}, None, 2,+ {"name": "invalid"}, {"id": None}, "kokoro:"], ["kokoro:af_heart", "kokoro:zf_xiaobei"]),+ (" af_heart, kokoro:zf_xiaobei, ", ["kokoro:af_heart", "kokoro:zf_xiaobei"]),+ ({"id": "af_heart"}, []), (42, []), (None, []),+])+def test_voice_normalization_rejects_invalid_entries(entries, expected):+ assert voice._normalize_kokoro_voices(entries) == expected+++def test_pinned_voices_do_not_request_server(monkeypatch, kokoro_config):+ kokoro_config["voices"] = "af_heart, zf_xiaobei"+ get = Mock(side_effect=AssertionError("manual voices must not request server"))+ monkeypatch.setattr(voice.requests, "get", get)+ assert voice.get_kokoro_voices(fallback=False) == ["kokoro:af_heart", "kokoro:zf_xiaobei"]+ get.assert_not_called()++[email protected]("failure", [requests.Timeout(), requests.ConnectionError(),+ ValueError("invalid JSON"), 401, 500, [], {"voices": None}])+def test_voice_discovery_failure_is_distinguishable(monkeypatch, kokoro_config, failure):+ if isinstance(failure, Exception):+ get = Mock(side_effect=failure)+ else:+ get = Mock(return_value=SimpleNamespace(+ status_code=failure if isinstance(failure, int) else 200,+ json=lambda: failure,+ ))+ monkeypatch.setattr(voice.requests, "get", get)+ assert voice.get_kokoro_voices(fallback=False) == []+ assert voice.get_kokoro_voices() == ["kokoro:af_heart"]++[email protected]("text", ["", " ", "...!!!", "😀"])+def test_unspeakable_text_does_not_make_requests(monkeypatch, kokoro_config, tmp_path, text):+ post = Mock()+ monkeypatch.setattr(voice.requests, "post", post)+ assert voice.kokoro_tts(text, "af_heart", str(tmp_path / "test.mp3")) is None+ post.assert_not_called()++[email protected]("provider", ["kokoro", "chatterbox"])[email protected]("rate, expected", [(0.1, 0.25), (1.2, 1.2), (5, 4.0)])+def test_transport_closes_audio_and_preserves_contract(monkeypatch, tmp_path, provider, rate, expected):+ monkeypatch.setattr(config, provider, {+ "base_url": "http://localhost:8880/v1/", "api_key": "key", "model_id": provider,+ })+ post = Mock(return_value=SimpleNamespace(status_code=200, content=b"audio", text=""))+ monkeypatch.setattr(voice.requests, "post", post)+ clip = Mock(duration=1.5)+ monkeypatch.setattr(voice, "AudioFileClip", Mock(return_value=clip))+ output = tmp_path / "output.mp3"+ maker = voice.tts("Hello world.", f"{provider}:af_heart-Female", rate, str(output))+ assert maker is not None+ assert output.read_bytes() == b"audio"+ assert list(tmp_path.iterdir()) == [output]+ clip.close.assert_called_once()+ payload = post.call_args.kwargs["json"]+ assert payload == {"model": provider, "input": "Hello world.", "voice": "af_heart",+ "response_format": "mp3", "speed": expected}+ assert post.call_args.kwargs["headers"]["Authorization"] == "Bearer key"++[email protected]("provider", ["kokoro", "chatterbox"])[email protected]("failure", ["empty", "decode", "zero", "nan", "replace", "http", "timeout"])+def test_failed_audio_never_overwrites_output(monkeypatch, tmp_path, provider, failure):+ """失败保留原文件,解码资源与临时文件均释放,包括 Windows 替换失败。"""+ output = tmp_path / "existing.mp3"+ output.write_bytes(b"previous audio")+ post = Mock(return_value=SimpleNamespace(+ status_code=503 if failure == "http" else 200,+ content=b"" if failure == "empty" else b"invalid audio", text="Unavailable"))+ if failure == "timeout":+ post.side_effect = requests.Timeout()+ monkeypatch.setattr(voice.requests, "post", post)+ clip = Mock(duration=0 if failure == "zero" else float("nan") if failure == "nan" else 1)+ reader = Mock(return_value=clip)+ if failure == "decode":+ reader.side_effect = ValueError("invalid audio")+ monkeypatch.setattr(voice, "AudioFileClip", reader)+ if failure == "replace":+ monkeypatch.setattr(voice.os, "replace", Mock(side_effect=PermissionError("in use")))+ assert voice._openai_compatible_tts(+ provider, "http://localhost/v1", "", provider, "af_heart", "Hello", 1, str(output)+ ) is None+ assert output.read_bytes() == b"previous audio"+ assert list(tmp_path.iterdir()) == [output]+ assert post.call_count == 3+ if failure in {"zero", "nan", "replace"}:+ assert clip.close.call_count == 3+++def test_transient_error_retries_successfully(monkeypatch, tmp_path):+ responses = [requests.Timeout(), SimpleNamespace(status_code=200, content=b"audio", text="")]+ post = Mock(side_effect=responses)+ monkeypatch.setattr(voice.requests, "post", post)+ monkeypatch.setattr(voice, "AudioFileClip", Mock(return_value=Mock(duration=1)))+ assert voice._openai_compatible_tts("kokoro", "http://localhost/v1", "", "kokoro",+ "af_heart", "Hello", 1, str(tmp_path / "a.mp3"))+ assert post.call_count == 2diff --git a/test/services/test_kokoro_integration.py b/test/services/test_kokoro_integration.pynew file mode 100644index 00000000..769aba8c--- /dev/null+++ b/test/services/test_kokoro_integration.py@@ -0,0 +1,50 @@+"""显式启用的真实服务测试;普通 CI 不需要安装或访问 Kokoro。++启动本机服务后,设置 MPT_KOKORO_TEST_BASE_URL=http://127.0.0.1:8880/v1+运行本文件。测试只合成短文本,不调用 LLM、素材平台或发布接口。+"""++import os++import pytest++from app.config import config+from app.services import voice+++BASE_URL = os.environ.get("MPT_KOKORO_TEST_BASE_URL", "")+pytestmark = pytest.mark.skipif(not BASE_URL, reason="requires an explicitly configured Kokoro test server")+++def live_config(monkeypatch):+ monkeypatch.setattr(config, "kokoro", {"base_url": BASE_URL, "api_key": "",+ "model_id": "kokoro", "voices": []})+++def test_live_voice_discovery(live_config):+ options = voice.get_kokoro_voices(fallback=False)+ assert "kokoro:af_heart" in options+ assert "kokoro:zf_xiaobei" in options+ assert all(option.startswith("kokoro:") and "{" not in option for option in options)++[email protected]("speaker, text", [+ ("af_heart", "Artificial intelligence is changing everyday life."),+ ("zf_xiaobei", "人工智能正在改变我们的生活。合理使用技术,让每个人受益。"),+ ("ff_siwis", "Bonjour ! L'intelligence artificielle nous aide à apprendre."),+ ("ef_dora", "La inteligencia artificial mejora nuestra vida cotidiana."),+ ("if_sara", "L'intelligenza artificiale migliora la vita di ogni giorno."),+ ("pf_dora", "A inteligência artificial melhora a nossa vida."),+ ("hf_alpha", "नमस्ते। कृत्रिम बुद्धिमत्ता हमारे जीवन को बेहतर बनाती है।"),+])+def test_live_audio_and_subtitles(live_config, tmp_path, speaker, text):+ output = tmp_path / "audio.mp3"+ maker = voice.tts(text, f"kokoro:{speaker}", 1, str(output))+ assert maker is not None+ assert output.stat().st_size > 100+ assert voice.get_audio_duration(str(output)) > 0+ subtitle = tmp_path / "subtitle.srt"+ voice.create_subtitle(maker, text, str(subtitle))+ assert "-->" in subtitle.read_text(encoding="utf-8")+ assert sorted(path.suffix for path in tmp_path.iterdir()) == [".mp3", ".srt"]diff --git a/test/services/test_webui_kokoro.py b/test/services/test_webui_kokoro.pynew file mode 100644index 00000000..fd77acc3--- /dev/null+++ b/test/services/test_webui_kokoro.py@@ -0,0 +1,88 @@+"""运行实际 Streamlit 页面,验证 Kokoro 音色刷新、断线和配置切换。"""++from pathlib import Path+from types import SimpleNamespace+from unittest.mock import Mock++import pytest+from streamlit.testing.v1 import AppTest++from app.config import config+from app.services import voice+++def ui(monkeypatch):+ monkeypatch.setattr(config, "ui", dict(config.ui, voice_mode="tts", tts_server="kokoro",+ voice_name="kokoro:zf_xiaobei"))+ monkeypatch.setattr(config, "kokoro", dict(base_url="http://localhost:8880/v1",+ api_key="", model_id="kokoro", voices=[]))+ monkeypatch.setattr(config, "save_config", Mock())+ monkeypatch.setattr(config, "try_save_config", Mock(return_value=True))+ page = AppTest.from_file(str(Path(__file__).parents[2] / "webui/Main.py"), default_timeout=30)+ page.session_state["ui_language"] = "zh"+ return page+++def selected_voice(page):+ return next(item for item in page.selectbox+ if str(item.key).startswith("speech_synthesis_select_kokoro"))+++def test_online_offline_recovery_retains_selection(monkeypatch, ui):+ """真实 rerun 穿过一次成功、一次断线、恢复,不能把保存音色改为默认值。"""+ get = Mock(side_effect=[["kokoro:af_heart", "kokoro:zf_xiaobei"], [],+ ["kokoro:af_heart", "kokoro:zf_xiaobei"]])+ monkeypatch.setattr(voice, "get_kokoro_voices", get)+ ui.run()+ assert selected_voice(ui).value == "kokoro:zf_xiaobei"+ ui.run()+ assert get.call_count == 1 # 缓存期内不重复访问服务。+ ui.session_state["kokoro_voice_catalog"]["checked_at"] = -100+ ui.run()+ assert selected_voice(ui).value == "kokoro:zf_xiaobei"+ assert config.ui["voice_name"] == "kokoro:zf_xiaobei"+ assert any("暂时无法获取 Kokoro" in str(w.value) for w in ui.warning)+ ui.session_state["kokoro_voice_catalog"]["checked_at"] = -100+ ui.run()+ assert selected_voice(ui).value == "kokoro:zf_xiaobei"+ assert not any("暂时无法获取 Kokoro" in str(w.value) for w in ui.warning)+ assert get.call_count == 3+ assert not ui.exception+++def test_first_open_offline_preserves_saved_voice(monkeypatch, ui):+ monkeypatch.setattr(voice, "get_kokoro_voices", Mock(return_value=[]))+ ui.run()+ assert selected_voice(ui).value == "kokoro:zf_xiaobei"+ assert config.ui["voice_name"] == "kokoro:zf_xiaobei"+ assert not ui.exception++[email protected]("input_key, value", [+ ("kokoro_base_url_input", "http://localhost:9999/v1"),+ ("kokoro_api_key_input", "new-test-key"),+])+def test_endpoint_or_credential_change_invalidates_cache(monkeypatch, ui, input_key, value):+ get = Mock(return_value=["kokoro:zf_xiaobei"])+ monkeypatch.setattr(voice, "get_kokoro_voices", get)+ ui.run()+ next(item for item in ui.text_input if item.key == input_key).set_value(value).run()+ assert get.call_count == 2+ assert not ui.exception+++def test_manual_voices_and_clearing_them(monkeypatch, ui):+ """手填音色立即使用;清空后自动发现,新版对象列表显示为简洁 ID。"""+ config.kokoro["voices"] = ["zf_xiaobei", "af_heart"]+ get = Mock(return_value=SimpleNamespace(status_code=200, json=lambda: {+ "voices": [{"id": "zf_xiaobei"}, {"id": "af_heart"}],+ }))+ monkeypatch.setattr(voice.requests, "get", get)+ ui.run()+ get.assert_not_called()+ next(item for item in ui.text_input if item.key == "kokoro_voices_input").set_value("").run()+ get.assert_called_once()+ assert selected_voice(ui).options == ["zf_xiaobei", "af_heart"]+ assert selected_voice(ui).value == "kokoro:zf_xiaobei"+ assert not ui.exceptiondiff --git a/webui/Main.py b/webui/Main.pyindex 93704f28..684d98e2 100644--- a/webui/Main.py+++ b/webui/Main.py@@ -434,11 +434,8 @@ def _sync_chatterbox_config_from_session_state():def _sync_kokoro_config_from_session_state():- # 与 Chatterbox 相同:Kokoro 配置输入框位于试听按钮之后,先从 session_state 同步一次。- # Streamlit 的按钮会触发整页 rerun,而 Kokoro 配置输入框位于- # “试听语音合成”按钮之后。如果试听时只读取 config.kokoro,可能拿不到- # 用户刚在输入框里填入的 base_url/model/voices。先从 session_state 同步一次,- # 可以保证按钮逻辑和输入框显示逻辑使用同一份最新配置。+ # 音色目录先于设置输入框渲染,先同步浏览器状态,确保本次 rerun 就使用+ # 新端点和手工音色配置,不必再操作一次控件。_set_runtime_config("kokoro","base_url",@@ -480,6 +477,38 @@ def _sync_kokoro_config_from_session_state():)+def _get_kokoro_voice_options(saved_voice_name: str) -> list[str]:+ """会话内短缓存远端目录,断线时保留上次选择,不把故障当成用户改音色。"""+ if config.kokoro.get("voices"):+ return voice.get_kokoro_voices()++ # 仅保留当前服务的一条缓存。更换端点/凭据立即重查,缓存不保存明文 Key;+ # 30 秒内的其他 UI 操作不重复阻塞 5 秒等待一个已知离线的服务。+ signature = (+ (config.kokoro.get("base_url") or "").strip().rstrip("/"),+ _credential_signature(config.kokoro.get("api_key", "")),+ )+ catalog = st.session_state.get("kokoro_voice_catalog", {})+ if catalog.get("signature") != signature:+ catalog = {"signature": signature, "voices": [], "checked_at": None}+ now = time.monotonic()+ if catalog["checked_at"] is None or now - catalog["checked_at"] >= 30:+ fetched = voice.get_kokoro_voices(fallback=False)+ catalog.update(checked_at=now, available=bool(fetched))+ if fetched:+ catalog["voices"] = fetched+ st.session_state["kokoro_voice_catalog"] = catalog++ options = list(catalog["voices"])+ if not catalog["available"]:+ st.warning(tr("Kokoro Voices Unavailable"))+ # 首次打开时可能没有缓存,仍保留配置文件中的真实选择;恢复连接后+ # 只有成功返回的新目录才能判定某个旧音色确实已被服务器删除。+ if voice.is_kokoro_voice(saved_voice_name) and saved_voice_name not in options:+ options.insert(0, saved_voice_name)+ return options or [f"kokoro:{voice.KOKORO_DEFAULT_VOICE}"]++def _detect_audio_mime(audio_file: str, audio_bytes: bytes) -> str:# 有些 OpenAI-compatible TTS 服务,例如 travisvn/chatterbox-tts-api,# 即使请求 response_format=mp3,也会返回 WAV 内容。WebUI 试听如果固定@@ -5950,7 +5979,7 @@ def _render_audio_settings(panel, params):elif selected_tts_server == "kokoro":# 自托管 Kokoro 服务的音色:[kokoro] voices 为空时从服务端 /audio/voices 读取_sync_kokoro_config_from_session_state()- filtered_voices = voice.get_kokoro_voices()+ filtered_voices = _get_kokoro_voice_options(saved_voice_name)elif selected_tts_server == "fish_audio":filtered_voices = voice.get_fish_audio_voices()else:@@ -5974,7 +6003,7 @@ def _render_audio_settings(panel, params):if voice.is_elevenlabs_voice(v):parts = v.split(":", 2)return parts[2] if len(parts) >= 3 else v- if voice.is_chatterbox_voice(v):+ if voice.is_chatterbox_voice(v) or voice.is_kokoro_voice(v):name = v.split(":", 1)[1] if ":" in v else vreturn name.replace("-Female", "").replace("-Male", "")if voice.is_minimax_voice(v):diff --git a/webui/i18n/de.json b/webui/i18n/de.jsonindex f0b81ed2..83b2c821 100644--- a/webui/i18n/de.json+++ b/webui/i18n/de.json@@ -1,6 +1,13 @@{"Language": "Deutsch","Translation": {+ "Kokoro Base URL": "Kokoro-Basis-URL",+ "Kokoro API Key": "Kokoro-API-Schlüssel (optional; [Einrichtung](https://github.com/remsky/Kokoro-FastAPI))",+ "Kokoro Model": "Kokoro-Modell",+ "Kokoro Voices": "Kokoro-Stimmen",+ "Kokoro Voices Placeholder": "Leer lassen, um Serverstimmen zu laden, z. B. af_heart, bf_emma, hf_alpha",+ "Kokoro Voices Unavailable": "Die Kokoro-Stimmen konnten nicht geladen werden. Die bisherige Auswahl bleibt erhalten. Prüfe die Verbindung oder trage Stimmen manuell ein.",+ "Kokoro Base URL Placeholder": "http://localhost:8880/v1","Login Required": "Anmeldung erforderlich","Please login to access settings": "Bitte melden Sie sich an, um auf die Einstellungen zuzugreifen","Username": "Benutzername",diff --git a/webui/i18n/en.json b/webui/i18n/en.jsonindex 321bf23b..11d25d29 100644--- a/webui/i18n/en.json+++ b/webui/i18n/en.json@@ -1,6 +1,7 @@{"Language": "English","Translation": {+ "Kokoro Voices Unavailable": "Could not load Kokoro voices. Your previous selection is retained. Check the connection or enter voices manually.","Login Required": "Login Required","Please login to access settings": "Please login to access settings","Username": "Username",diff --git a/webui/i18n/es.json b/webui/i18n/es.jsonindex 0df98f0c..eb3296f2 100644--- a/webui/i18n/es.json+++ b/webui/i18n/es.json@@ -1,6 +1,13 @@{"Language": "Español","Translation": {+ "Kokoro Base URL": "URL base de Kokoro",+ "Kokoro API Key": "Clave API de Kokoro (opcional; [Configuración](https://github.com/remsky/Kokoro-FastAPI))",+ "Kokoro Model": "Modelo de Kokoro",+ "Kokoro Voices": "Voces de Kokoro",+ "Kokoro Voices Placeholder": "Déjalo vacío para cargar las voces del servidor, o escribe af_heart, bf_emma, hf_alpha",+ "Kokoro Voices Unavailable": "No se pudieron cargar las voces de Kokoro. Se conserva la selección anterior. Comprueba la conexión o introduce las voces manualmente.",+ "Kokoro Base URL Placeholder": "http://localhost:8880/v1","Login Required": "Inicio de sesión requerido","Please login to access settings": "Inicia sesión para acceder a la configuración","Username": "Usuario",diff --git a/webui/i18n/fr.json b/webui/i18n/fr.jsonindex e15cd13b..365217ea 100644--- a/webui/i18n/fr.json+++ b/webui/i18n/fr.json@@ -1,6 +1,13 @@{"Language": "Français","Translation": {+ "Kokoro Base URL": "URL de base de Kokoro",+ "Kokoro API Key": "Clé API Kokoro (facultative ; [Configuration](https://github.com/remsky/Kokoro-FastAPI))",+ "Kokoro Model": "Modèle Kokoro",+ "Kokoro Voices": "Voix Kokoro",+ "Kokoro Voices Placeholder": "Laisser vide pour charger les voix du serveur, ou saisir af_heart, bf_emma, hf_alpha",+ "Kokoro Voices Unavailable": "Impossible de charger les voix Kokoro. La sélection précédente est conservée. Vérifiez la connexion ou saisissez les voix manuellement.",+ "Kokoro Base URL Placeholder": "http://localhost:8880/v1","Login Required": "Connexion requise","Please login to access settings": "Veuillez vous connecter pour accéder aux paramètres","Username": "Nom d'utilisateur",diff --git a/webui/i18n/id.json b/webui/i18n/id.jsonindex 1f0b788a..15d330ac 100644--- a/webui/i18n/id.json+++ b/webui/i18n/id.json@@ -1,6 +1,13 @@{"Language": "Bahasa Indonesia","Translation": {+ "Kokoro Base URL": "URL Dasar Kokoro",+ "Kokoro API Key": "Kunci API Kokoro (opsional; [Panduan Konfigurasi](https://github.com/remsky/Kokoro-FastAPI))",+ "Kokoro Model": "Model Kokoro",+ "Kokoro Voices": "Suara Kokoro",+ "Kokoro Voices Placeholder": "Kosongkan untuk memuat suara server, atau isi af_heart, bf_emma, hf_alpha",+ "Kokoro Voices Unavailable": "Daftar suara Kokoro tidak dapat dimuat. Pilihan sebelumnya tetap disimpan. Periksa koneksi atau masukkan suara secara manual.",+ "Kokoro Base URL Placeholder": "http://localhost:8880/v1","Login Required": "Login Diperlukan","Please login to access settings": "Silakan login untuk mengakses pengaturan","Username": "Nama Pengguna",diff --git a/webui/i18n/it.json b/webui/i18n/it.jsonindex b653b5bd..8679d9f8 100644--- a/webui/i18n/it.json+++ b/webui/i18n/it.json@@ -1,6 +1,13 @@{"Language": "Italiano","Translation": {+ "Kokoro Base URL": "URL di base di Kokoro",+ "Kokoro API Key": "Chiave API Kokoro (facoltativa; [Configurazione](https://github.com/remsky/Kokoro-FastAPI))",+ "Kokoro Model": "Modello Kokoro",+ "Kokoro Voices": "Voci Kokoro",+ "Kokoro Voices Placeholder": "Lascia vuoto per caricare le voci del server, oppure inserisci af_heart, bf_emma, hf_alpha",+ "Kokoro Voices Unavailable": "Impossibile caricare le voci Kokoro. La selezione precedente viene mantenuta. Controlla la connessione o inserisci le voci manualmente.",+ "Kokoro Base URL Placeholder": "http://localhost:8880/v1","Login Required": "Accesso richiesto","Please login to access settings": "Effettua l'accesso per accedere alle impostazioni","Username": "Nome utente",diff --git a/webui/i18n/ko.json b/webui/i18n/ko.jsonindex e93ac682..071c3119 100644--- a/webui/i18n/ko.json+++ b/webui/i18n/ko.json@@ -1,6 +1,13 @@{"Language": "한국어","Translation": {+ "Kokoro Base URL": "Kokoro 기본 URL",+ "Kokoro API Key": "Kokoro API 키 (선택 사항; [설정 안내](https://github.com/remsky/Kokoro-FastAPI))",+ "Kokoro Model": "Kokoro 모델",+ "Kokoro Voices": "Kokoro 음성",+ "Kokoro Voices Placeholder": "비워 두면 서버의 음성을 불러옵니다. 직접 입력 예: af_heart, bf_emma, hf_alpha",+ "Kokoro Voices Unavailable": "Kokoro 음성 목록을 불러오지 못했습니다. 기존 선택은 유지됩니다. 연결을 확인하거나 음성을 직접 입력하세요.",+ "Kokoro Base URL Placeholder": "http://localhost:8880/v1","Login Required": "로그인 필요","Please login to access settings": "설정에 접근하려면 로그인하세요","Username": "사용자 이름",diff --git a/webui/i18n/pt.json b/webui/i18n/pt.jsonindex 41d55170..b4436967 100644--- a/webui/i18n/pt.json+++ b/webui/i18n/pt.json@@ -1,6 +1,13 @@{"Language": "Português","Translation": {+ "Kokoro Base URL": "URL base do Kokoro",+ "Kokoro API Key": "Chave de API do Kokoro (opcional; [Configuração](https://github.com/remsky/Kokoro-FastAPI))",+ "Kokoro Model": "Modelo do Kokoro",+ "Kokoro Voices": "Vozes do Kokoro",+ "Kokoro Voices Placeholder": "Deixe vazio para carregar as vozes do servidor ou digite af_heart, bf_emma, hf_alpha",+ "Kokoro Voices Unavailable": "Não foi possível carregar as vozes do Kokoro. A seleção anterior foi mantida. Verifique a conexão ou informe as vozes manualmente.",+ "Kokoro Base URL Placeholder": "http://localhost:8880/v1","Login Required": "Login Necessário","Please login to access settings": "Por favor, faça login para acessar as configurações","Username": "Nome de usuário",diff --git a/webui/i18n/ru.json b/webui/i18n/ru.jsonindex 14070b61..488b1f30 100644--- a/webui/i18n/ru.json+++ b/webui/i18n/ru.json@@ -1,6 +1,13 @@{"Language": "Русский","Translation": {+ "Kokoro Base URL": "Базовый URL Kokoro",+ "Kokoro API Key": "API-ключ Kokoro (необязательно; [Настройка](https://github.com/remsky/Kokoro-FastAPI))",+ "Kokoro Model": "Модель Kokoro",+ "Kokoro Voices": "Голоса Kokoro",+ "Kokoro Voices Placeholder": "Оставьте пустым для загрузки голосов с сервера или укажите af_heart, bf_emma, hf_alpha",+ "Kokoro Voices Unavailable": "Не удалось загрузить голоса Kokoro. Предыдущий выбор сохранён. Проверьте подключение или укажите голоса вручную.",+ "Kokoro Base URL Placeholder": "http://localhost:8880/v1","Login Required": "Требуется вход","Please login to access settings": "Войдите, чтобы открыть настройки","Username": "Имя пользователя",diff --git a/webui/i18n/tr.json b/webui/i18n/tr.jsonindex f08c6f6e..08d97507 100644--- a/webui/i18n/tr.json+++ b/webui/i18n/tr.json@@ -1,6 +1,13 @@{"Language": "Türkçe","Translation": {+ "Kokoro Base URL": "Kokoro Temel URL",+ "Kokoro API Key": "Kokoro API Anahtarı (isteğe bağlı; [Kurulum](https://github.com/remsky/Kokoro-FastAPI))",+ "Kokoro Model": "Kokoro Modeli",+ "Kokoro Voices": "Kokoro Sesleri",+ "Kokoro Voices Placeholder": "Sunucu seslerini yüklemek için boş bırakın veya af_heart, bf_emma, hf_alpha girin",+ "Kokoro Voices Unavailable": "Kokoro sesleri yüklenemedi. Önceki seçim korundu. Bağlantıyı kontrol edin veya sesleri elle girin.",+ "Kokoro Base URL Placeholder": "http://localhost:8880/v1","Login Required": "Giriş Gerekli","Please login to access settings": "Ayarlara erişmek için lütfen giriş yapın","Username": "Kullanıcı Adı",diff --git a/webui/i18n/vi.json b/webui/i18n/vi.jsonindex 8c5b30ce..b15f239b 100644--- a/webui/i18n/vi.json+++ b/webui/i18n/vi.json@@ -1,6 +1,13 @@{"Language": "Tiếng Việt","Translation": {+ "Kokoro Base URL": "URL cơ sở Kokoro",+ "Kokoro API Key": "Khóa API Kokoro (không bắt buộc; [Hướng dẫn cấu hình](https://github.com/remsky/Kokoro-FastAPI))",+ "Kokoro Model": "Mô hình Kokoro",+ "Kokoro Voices": "Giọng Kokoro",+ "Kokoro Voices Placeholder": "Để trống để tải giọng từ máy chủ, hoặc nhập af_heart, bf_emma, hf_alpha",+ "Kokoro Voices Unavailable": "Không thể tải danh sách giọng Kokoro. Lựa chọn trước đó được giữ lại. Kiểm tra kết nối hoặc nhập giọng thủ công.",+ "Kokoro Base URL Placeholder": "http://localhost:8880/v1","Login Required": "Yêu cầu đăng nhập","Please login to access settings": "Vui lòng đăng nhập để truy cập cài đặt","Username": "Tên đăng nhập",diff --git a/webui/i18n/zh.json b/webui/i18n/zh.jsonindex 67e1045a..1f4c1440 100644--- a/webui/i18n/zh.json+++ b/webui/i18n/zh.json@@ -1,6 +1,7 @@{"Language": "简体中文","Translation": {+ "Kokoro Voices Unavailable": "暂时无法获取 Kokoro 音色,已保留原有选择。请检查服务连接,或手动填写音色。","Login Required": "需要登录","Please login to access settings": "请登录后访问配置设置 (:gray[默认用户名: admin, 密码: admin, 您可以在 config.toml 中修改])","Username": "用户名",