feat: Add emotion handling to audiobook segments with emo_text and emo_alpha attributes

This commit is contained in:
2026-03-12 14:34:20 +08:00
parent 1757f39322
commit bbcfc0e8d3
8 changed files with 37 additions and 5 deletions

View File

@@ -593,6 +593,8 @@ def create_audiobook_segment(
text: str,
chapter_index: int = 0,
segment_index: int = 0,
emo_text: Optional[str] = None,
emo_alpha: Optional[float] = None,
) -> AudiobookSegment:
seg = AudiobookSegment(
project_id=project_id,
@@ -600,6 +602,8 @@ def create_audiobook_segment(
text=text,
chapter_index=chapter_index,
segment_index=segment_index,
emo_text=emo_text or None,
emo_alpha=emo_alpha,
status="pending",
)
db.add(seg)