Add voice management functionality and voice synthesis preview

- Implemented voice management routes in `voices.py` for listing, saving, and deleting speaker configurations.
- Added a test endpoint for voice synthesis preview, allowing users to test voice settings with provided text and speed.
- Introduced utility functions in `voice.py` for building voice catalogs, resolving voice settings, and synthesizing audio from normalized text.
- Enhanced speaker roster building and configuration application logic to support dynamic voice settings.
This commit is contained in:
JB
2025-11-28 14:57:23 -08:00
parent 0a2b3533f4
commit d08cbcfdc9
23 changed files with 4780 additions and 5463 deletions
+5 -4
View File
@@ -2,7 +2,8 @@ from pathlib import Path
from werkzeug.datastructures import MultiDict
from abogen.web.routes import _apply_prepare_form, _resolve_voice_setting
from abogen.web.routes.utils.form import apply_prepare_form
from abogen.web.routes.utils.voice import resolve_voice_setting
from abogen.web.service import PendingJob
@@ -55,7 +56,7 @@ def test_apply_prepare_form_handles_custom_mix_for_speakers():
}
)
_, _, _, errors, *_ = _apply_prepare_form(pending, form)
_, _, _, errors, *_ = apply_prepare_form(pending, form)
assert not errors
hero = pending.speakers["hero"]
@@ -75,7 +76,7 @@ def test_resolve_voice_setting_handles_profile_reference():
}
}
voice, profile_name, language = _resolve_voice_setting("profile:Blend", profiles=profiles)
voice, profile_name, language = resolve_voice_setting("profile:Blend", profiles=profiles)
assert voice == "af_nova*0.5+am_liam*0.5"
assert profile_name == "Blend"
@@ -89,6 +90,6 @@ def test_apply_prepare_form_updates_closing_outro_flag():
"read_closing_outro": "false",
})
_apply_prepare_form(pending, form)
apply_prepare_form(pending, form)
assert pending.read_closing_outro is False