aboutsummaryrefslogtreecommitdiff
path: root/app/backends/audiocpp/__init__.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-08-26 02:25:55 -0400
committerhistoria <historiavg@proton.me>2026-08-26 02:25:55 -0400
commit8b5c8697740ff415cf7f1d03c9fb5a8c8851d420 (patch)
tree28c0323c54c896af5f89fb34b89a62e0fe0df291 /app/backends/audiocpp/__init__.py
parentacbd9ff2c91182d96c57ffb57bee6e9b3fcbcbd4 (diff)
downloadtts-audiobook-generator-8b5c8697740ff415cf7f1d03c9fb5a8c8851d420.tar.gz
refactor: audiocpp.py setup flow
Diffstat (limited to 'app/backends/audiocpp/__init__.py')
-rw-r--r--app/backends/audiocpp/__init__.py107
1 files changed, 107 insertions, 0 deletions
diff --git a/app/backends/audiocpp/__init__.py b/app/backends/audiocpp/__init__.py
new file mode 100644
index 0000000..84166af
--- /dev/null
+++ b/app/backends/audiocpp/__init__.py
@@ -0,0 +1,107 @@
+"""audio.cpp backend — setup wizard, server config, model management.
+
+A package of focused modules behind one import surface: everything public
+is re-exported here, so callers (the hub, the CLI, tests) keep using
+``backends.audiocpp.<name>`` regardless of which module implements it.
+
+Modules:
+ constants shared constants (backends, tasks, checkout location)
+ catalog the model_specs catalog + server.json building/selections
+ models install state on disk, missing-model guidance, downloads
+ voices reference-.wav transcription planning and execution
+ configsync app/converter/config.py + server.json port/id/backend sync
+ build checkout lifecycle: ggml patches, binary build, uninstall
+ remote querying a running server for its models/voices
+ status detect() for the hub's backend menu
+ wizard the TUI wizard and the CLI entry points
+"""
+
+from .constants import (
+ AUDIOCPP_DIR_NAME,
+ AUDIOCPP_GIT_URL,
+ BACKENDS,
+ DEFAULT_HOST,
+ FALLBACK_PORT,
+ PATCH_DIR,
+ TASK_TTS,
+ TASK_VDES,
+)
+from .catalog import (
+ _backend_options,
+ _default_package,
+ detect_backend,
+ is_design_package,
+ load_model_catalog,
+ package_dir_options,
+ build_model_entry,
+ build_server_config,
+ load_server_config,
+ server_config_selections,
+)
+from .models import (
+ delete_model_files,
+ hand_install_guidance,
+ install_models,
+ installed_model_entries,
+ missing_model_entries,
+ missing_model_install_guidance,
+ model_install_hints,
+ unused_installed_entries,
+)
+from .voices import (
+ print_empty_transcript_warning,
+ transcribe_wav_dir,
+)
+from .configsync import (
+ config_port,
+ update_config_api_url_port,
+ update_config_model_ids,
+ update_server_backend,
+ update_server_config_port,
+)
+from .build import (
+ apply_ggml_patches,
+ build_audiocpp,
+ find_build_script,
+ find_local_checkout,
+ find_audiocpp_server_bin,
+ uninstall,
+)
+from .remote import fetch_server_models, fetch_server_voices
+from .wizard import (
+ build_parser,
+ build_screen,
+ main,
+ run_tui,
+ setup_screen,
+)
+from .status import detect
+
+__all__ = [
+ # constants
+ "AUDIOCPP_DIR_NAME", "AUDIOCPP_GIT_URL", "BACKENDS", "DEFAULT_HOST",
+ "FALLBACK_PORT", "PATCH_DIR", "TASK_TTS", "TASK_VDES",
+ # catalog
+ "detect_backend", "load_model_catalog", "is_design_package",
+ "package_dir_options", "build_model_entry", "build_server_config",
+ "load_server_config", "server_config_selections",
+ # models
+ "missing_model_entries", "installed_model_entries",
+ "unused_installed_entries", "delete_model_files", "install_models",
+ "hand_install_guidance", "missing_model_install_guidance",
+ "model_install_hints",
+ # voices
+ "transcribe_wav_dir", "print_empty_transcript_warning",
+ # configsync
+ "config_port", "update_config_api_url_port",
+ "update_config_model_ids", "update_server_config_port",
+ "update_server_backend",
+ # build
+ "find_local_checkout", "find_audiocpp_server_bin", "find_build_script",
+ "apply_ggml_patches", "build_audiocpp", "uninstall",
+ # remote
+ "fetch_server_models", "fetch_server_voices",
+ # wizard / status
+ "setup_screen", "build_screen", "run_tui", "build_parser", "detect",
+ "main",
+]