How rafael1mc/epub-tts works
Main Components
a. Input Layer:
• Input ePub file in the volume/input.epub directory
b. Core Processing Components (arrange these in a pipeline flow):
1. ePub Parser Component (from internal/book)
• Epub.go and epub-parser.go as the main processing units
• Represents the initial file processing and content extraction
2. Text Processing Component (from internal/book)
• Text-book.go as the intermediate processing unit
• Handles the conversion of ePub content into processable text sections
3. TTS Engine Interface (from internal/tts)
• Tts.go connecting to external MacOS 'say' command
• Represents the text-to-speech conversion process
c. Support Components (show these as utility modules):
• File Handler (internal/file)
• String Utilities (internal/str)
• Debug Tools (internal/debug)
• Constants (internal/consts)
Flow and Relationships
[Input ePub] → [ePub Parser] → [Text Processor] → [TTS Engine] → [Audio Output Files]
• ↑ ↑ ↑ ↑
• [Utility Modules]──────────┘
Important Elements to Highlight
a. Worker Pool System:
• Parallel processing capabilities
• Batch conversion flow
b. External Dependencies:
• FFmpeg integration
• MacOS 'say' command
• As external service dependencies
Technical Details
• Input Format: ePub files
• Output Format: Audio files (with numerical prefixes)
• System Requirements: MacOS, FFmpeg, Go runtime
• File Organization: Show how output files are created and organized
Specific Implementation Notes
• Worker pool architecture for parallel processing
• Where file size optimization occurs
• Chapter extraction process
• Where language processing happens
Remember to:
• System boundaries
• External system dependencies
• Where future expansions (like Web UI) would fit
• Points where performance optimizations occur
This design should emphasize the pipeline nature of the processing while showing how the various internal packages work together to achieve the conversion from ePub to audio files.