Add audio generation config, refactor rep_announcer
- AudioConfig now includes rep_max_count and rep_audio_dir - app/audio/generate.py uses config instead of hardcoded constants - RepAnnouncer rewrote with pre-generated audio cache - Supports Windows winsound, macOS afplay, Linux paplay/aplay - Pin requirements back to mediapipe==0.10.21 with numpy<2
This commit is contained in:
@@ -46,6 +46,15 @@ class AudioConfig:
|
||||
rep_announcer_enabled: bool = True
|
||||
rep_announcer_rate: int = 185
|
||||
rep_announcer_volume: float = 1.0
|
||||
rep_max_count: int = 200
|
||||
rep_audio_dir: str = ""
|
||||
|
||||
@property
|
||||
def resolved_audio_dir(self) -> Path:
|
||||
"""返回语音文件目录的绝对路径"""
|
||||
if self.rep_audio_dir:
|
||||
return Path(self.rep_audio_dir)
|
||||
return Path(__file__).resolve().parent.parent / "app" / "audio" / "reps"
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
Reference in New Issue
Block a user