How jarodmica/audiobook_maker works
Project Type & Purpose
• This is a full-stack desktop application designed for Windows (with potential cross-platform UI via PySide6) that leverages multiple open-source deep learning text-to-speech (TTS) and speech-to-speech (S2S) engines to create high-quality audiobooks.
• Its modular design lets you swap in different engines (TortoiseTTS, F5-TTS, StyleTTS, RVC) without hardcoding engine specifics, making the system highly extensible.
File Structure
• Notice key top-level directories:
• The “src” folder contains the MVC components:
▪ view.py (GUI interface using PySide6),
▪ controller.py (the application logic/brain),
▪ model.py (handles core functionality and data flow).
• The “engines” directory holds the implementations for each engine category (TTS or S2S) with subdirectories for models, tokenizers, vocoders, etc.
• “modules” encapsulates different API wrappers for TTS engines (e.g., Tortoise, StyleTTS, F5-TTS) to neatly package external integrations.
• “configs” provides JSON and YAML files for engine-specific configurations.
• Other helper directories include “assets” (for styling and images), “voices”, “models”, and directories to manage input texts.
Key Components & Their Relationships
a. Core MVC Structure:
• View (GUI): Handles user interactions and dynamically builds widgets based on the configuration and available engines.
• Controller: Interprets the user’s actions, triggers engine-specific functions, and manages workflow (triggering TTS generation, handling regenerations, multi-speaker setup, etc.).
• Model: Contains the business logic and ties together engine outputs, error logging (e.g., returning audio paths), and internal data management.
b. Engine Integration:
• Each engine module connects back to the model (via engine handler functions in src/tts_engines.py and src/s2s_engines.py) that dynamically determine which engine to activate based on configuration files in “configs”.
c. External Dependencies & Deployment:
• Dependencies include CUDA (with a version-verified torch installation) and other libraries like ffmpeg.
• Build scripts such as .bat files (up.bat, finish_styletts_install.bat, update_package.bat) support deployment and installation on Windows systems.
Architectural Patterns and Design Principles
• Modularity: The design deliberately separates engine-specific logic from the core functionality, simply returning an audio path to the model. This is vital for maintaining and extending the system.
• MVC Pattern: Clear segregation between the GUI (view), business logic (controller), and core processing (model) helps manage complexity as the system grows.
• Dynamic Component Integration: New engines can be added simply by providing new configuration files, making the system plugin-friendly.