From 87e5216cd287f411b2ffab04dbc435f48c1d4aae Mon Sep 17 00:00:00 2001 From: historia Date: Wed, 19 Aug 2026 03:55:13 -0400 Subject: refactor: config.py simplified --- audiobook.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'audiobook.py') diff --git a/audiobook.py b/audiobook.py index 3c27aac..31777e8 100755 --- a/audiobook.py +++ b/audiobook.py @@ -21,8 +21,13 @@ if sys.platform == "win32": pass from converter import config -from converter.converter import AudiobookConverter, setup_directories, setup_logging -from converter.tts import normalize_language +from converter.converter import ( + AUDIO_FORMATS, + AudiobookConverter, + setup_directories, + setup_logging, +) +from converter.tts import VOICE_MODE_CLONE, VOICE_MODE_CUSTOM, normalize_language def main() -> None: @@ -74,7 +79,7 @@ Examples: metavar="LANG", help=("Output language for the synthesized speech, e.g. English, Japanese, " "or Auto (language names and short codes like en/ja are accepted). " - "Defaults to the mode's setting in converter/config.py (English).") + "Defaults to the LANGUAGE setting in converter/config.py (English).") ) parser.add_argument( @@ -86,7 +91,7 @@ Examples: parser.add_argument( "--format", - choices=list(config.AUDIO_FORMATS), + choices=list(AUDIO_FORMATS), default=config.AUDIO_FORMAT, help=f"Output container format (default: {config.AUDIO_FORMAT}). m4b uses AAC audio." ) @@ -164,8 +169,8 @@ Examples: try: converter = AudiobookConverter( - voice_mode=config.VOICE_MODE_CLONE if (args.clone or args.faster) - else config.VOICE_MODE_CUSTOM, + voice_mode=VOICE_MODE_CLONE if (args.clone or args.faster) + else VOICE_MODE_CUSTOM, voice_clone_ref_audio=args.clone, voice_clone_ref_text=args.transcription, skip_transcription=args.no_transcription, -- cgit v1.2.3