aboutsummaryrefslogtreecommitdiff
path: root/converter/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'converter/config.py')
-rw-r--r--converter/config.py46
1 files changed, 44 insertions, 2 deletions
diff --git a/converter/config.py b/converter/config.py
index ec84986..f795520 100644
--- a/converter/config.py
+++ b/converter/config.py
@@ -7,7 +7,7 @@ be run from any working directory.
from pathlib import Path
-# Project root (directory containing audiobook_converter.py)
+# Project root (directory containing audiobook.py)
BASE_DIR = Path(__file__).resolve().parent.parent
# =============================================================================
@@ -19,6 +19,48 @@ VOICE_MODE_CLONE = "voice_clone"
VOICE_MODES = (VOICE_MODE_CUSTOM, VOICE_MODE_CLONE)
# =============================================================================
+# TTS LANGUAGE SETTINGS
+# =============================================================================
+# Languages understood by the Qwen3-TTS API. The Gradio demo silently falls
+# back to "Auto" for unrecognized values, so languages are validated
+# client-side (see converter.tts.normalize_language) before reaching the API.
+# Display names must match the demo dropdown exactly.
+
+TTS_LANGUAGES = (
+ "Auto",
+ "Chinese",
+ "English",
+ "German",
+ "Italian",
+ "Portuguese",
+ "Spanish",
+ "Japanese",
+ "Korean",
+ "French",
+ "Russian",
+)
+
+# Short aliases accepted on the command line (ISO 639-1 codes and common
+# shorthands), mapped to the display names above.
+TTS_LANGUAGE_ALIASES = {
+ "zh": "Chinese",
+ "en": "English",
+ "de": "German",
+ "it": "Italian",
+ "pt": "Portuguese",
+ "es": "Spanish",
+ "ja": "Japanese",
+ "ko": "Korean",
+ "fr": "French",
+ "ru": "Russian",
+ "zh-cn": "Chinese",
+ "zh-tw": "Chinese",
+ "pt-br": "Portuguese",
+ "en-us": "English",
+ "en-gb": "English",
+}
+
+# =============================================================================
# QWEN API CONFIGURATION
# =============================================================================
@@ -82,7 +124,7 @@ HEARTBEAT_INTERVAL_SECONDS = 30 # Print "still working" this often during a chu
# AUDIO OUTPUT SETTINGS
# =============================================================================
-AUDIO_FORMAT = "mp3" # Default output container
+AUDIO_FORMAT = "m4b" # Default output container
AUDIO_FORMATS = ("mp3", "m4b", "ogg", "flac")
AUDIO_BITRATE = "128k"