Restructure into asr/tts packages and add TTS tab skeleton
Split the single ASR gateway into app/main.py (entrypoint) + app/core (shared env helpers) + app/asr (all existing ASR logic, unchanged behavior) + app/tts (placeholder router/config, no engine yet), so a real TTS backend can be dropped in later without reshuffling ASR code. API moved under /asr/* and /tts/* prefixes; UI gained a top-level ASR/TTS tab switcher built on a reusable nested .tab-group mechanism, with JS split into common.js/asr.js/tts.js. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
0
app/tts/__init__.py
Normal file
0
app/tts/__init__.py
Normal file
12
app/tts/config.py
Normal file
12
app/tts/config.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from core.config import env_str
|
||||
|
||||
TTS_BASE_DIR = Path(env_str("TTS_BASE_DIR", "/srv/tts"))
|
||||
TTS_MODEL_CACHE = Path(env_str("TTS_MODEL_CACHE_DIR", str(TTS_BASE_DIR / "models-cache")))
|
||||
TTS_UPLOAD_DIR = TTS_BASE_DIR / "uploads"
|
||||
TTS_RESULT_DIR = TTS_BASE_DIR / "results"
|
||||
|
||||
DEFAULT_TTS_BACKEND = env_str("DEFAULT_TTS_BACKEND", "")
|
||||
29
app/tts/router.py
Normal file
29
app/tts/router.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict, List
|
||||
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
from tts.config import DEFAULT_TTS_BACKEND
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/config")
|
||||
def config() -> Dict[str, Any]:
|
||||
return {
|
||||
"status": "not_implemented",
|
||||
"default_backend": DEFAULT_TTS_BACKEND,
|
||||
"backends": {},
|
||||
"message": "TTS 백엔드가 아직 연동되지 않았습니다.",
|
||||
}
|
||||
|
||||
|
||||
@router.get("/history")
|
||||
def list_history() -> List[Dict[str, Any]]:
|
||||
return []
|
||||
|
||||
|
||||
@router.post("/synthesize")
|
||||
def synthesize() -> None:
|
||||
raise HTTPException(status_code=501, detail="TTS 합성 기능은 아직 구현되지 않았습니다.")
|
||||
Reference in New Issue
Block a user