feat(radio): replace robot TTS with Piper Neural voices & add instant voice preview
- Integrate local Piper ONNX neural TTS engine (Dmitri, Irina, Denis, Ruslan) - Add GET /api/radio/preview-voice endpoint with cached pre-rendered samples - Add '▶ Прослушать голос' button in Web UI for 1-click preview before generating - Add automated filter to strip LLM refusals and fall back to clean radio phrasing
This commit is contained in:
1 parent
e5afeb06cc
commit
4ed8e0c71a
7 files changed
+183
-24
No files matched your search
+14
-1
@@ -22,7 +22,7 @@ from app.core.auth import (
|
||||
)
|
||||
from app.wave.rotator import wave_rotator
|
||||
from app.wave.playlist import ensure_smart_playlist
|
||||
from app.radio import radio_manager
|
||||
from app.radio import radio_manager, dj_host
|
||||
|
||||
app = FastAPI(title="Navidrome Music Sync", version="1.0.0")
|
||||
|
||||
@@ -334,3 +334,16 @@ async def generate_radio_broadcast(req: Optional[RadioGenerateRequest] = None, u
|
||||
res = await radio_manager.generate_radio_broadcast(voice=voice)
|
||||
return res
|
||||
|
||||
@app.get("/api/radio/preview-voice")
|
||||
def preview_voice(voice: str = Query(...)):
|
||||
"""Stream voice sample preview."""
|
||||
preview_path = dj_host.get_voice_preview_path(voice)
|
||||
if not preview_path or not os.path.exists(preview_path):
|
||||
raise HTTPException(status_code=404, detail="Превью голоса не найдено")
|
||||
return FileResponse(
|
||||
preview_path,
|
||||
media_type="audio/mpeg",
|
||||
headers={"Content-Disposition": f"inline; filename=preview_{voice}.mp3"}
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user