Skip to content

Core Modules

Detailed documentation of core service modules.

1. Generation Service (src/services/generation/)

Core business logic module with responsibility-based separation:

SubmoduleFile/DirectoryDescription
pipelineindex.tsGeneration orchestrator, coordinates full flow
pipelineCore.tsShared context & dependency injection
chunkProcessor.tsSingle chunk processing (transcribe → wait deps → translate)
translation.tsTranslation execution logic
glossaryHandler.tsGlossary application logic
resultTransformers.tsResult transformation & post-processing
core/BaseStep.tsStep base class, unified interface
steps/*.tsStep implementations (Transcription, Refinement, Alignment, etc.)
extractorsglossary.tsGlossary extractor (Gemini Pro + Search)
speakerProfile.tsSpeaker profile extractor
batchproofread.tsBatch proofreading operation
regenerate.tsBatch regeneration (full pipeline rerun)

2. Gemini API Core (src/services/api/gemini/core/)

Core API interaction capabilities:

FileDescription
client.tsGemini API client wrapper, auth, retry, quota handling
prompts.tsBase prompt template library
schemas.tsStructured output schema definitions

3. Audio Processing (src/services/audio/)

FileDescription
segmenter.tsSmart audio segmenter, Silero VAD for semantic boundary splitting
sampler.tsAudio sampling for AI analysis
decoder.tsMulti-format audio decoding
processor.tsAudio preprocessing, normalization
converter.tsAudio format conversion
ffmpegExtractor.tsFFmpeg audio extraction (core logic)

4. Subtitle Processing (src/services/subtitle/)

FileDescription
parser.tsSubtitle parser, SRT/ASS/VTT support
generator.tsSubtitle export, bilingual generation
time.tsTimecode processing utilities
postCheck.tsSubtitle quality post-check
timelineValidator.tsTimeline logic validation
reconciler.tsData reconciler (metadata merging)

5. Download Service (src/services/download/)

FileDescription
download.tsVideo download logic
utils.tsDownload utility functions

6. Model Selection Strategy

Model configuration centralized in src/config/models.ts:

Processing StepDefault ModelFeatures
refinementGemini 2.5 FlashTimeline correction (avoid 3.0 bug)
translationGemini 3 Flash PreviewTranslation, Search Grounding
glossaryExtractionGemini 3 Pro PreviewMultimodal, glossary extraction
speakerProfileGemini 3 Pro PreviewSpeaker analysis
batchProofreadGemini 3 Pro PreviewHigh-quality proofreading

Note: Since v2.13, batchFixTimestamps replaced by regenerate. Regenerate reruns full pipeline.

Per-step configuration options:

  • thinkingLevel: Thinking depth (none/low/medium/high)
  • useSearch: Enable Google Search
  • maxOutputTokens: Maximum output tokens

7. i18n Module (src/locales/, src/i18n.ts)

Full internationalization with i18next, supporting Chinese/English/Japanese:

File/DirectoryDescription
i18n.tsi18n config entry, initialize i18next + React
locales/Translation resource root
zh-CN/Simplified Chinese, 14 namespace files
en-US/English, same structure as zh-CN
ja-JP/Japanese (v2.13)

Namespace Organization:

NamespaceContent
commonCommon text (buttons, labels, errors)
homeHome page
workspaceWorkspace page
editorSubtitle editor
settingsSettings modal
endToEndEnd-to-end wizard
modalsBusiness modals
servicesAPI service messages
compressionVideo encoding page
downloadDownload page
progressProgress indicators
uiUI components
appApplication-level text

8. Settings Module (src/components/settings/)

v2.13 refactored into modular tabs structure:

File/DirectoryDescription
SettingsModal.tsxSettings modal container, tab management
tabs/GeneralTab.tsxGeneral settings (language, theme)
tabs/ServicesTab.tsxAPI service config (Gemini, OpenAI keys)
tabs/EnhanceTab.tsxEnhancement features (glossary, speaker toggle)
tabs/PerformanceTab.tsxPerformance settings (concurrency, cache)
tabs/DebugTab.tsxDebug options (mock mode, log level)
tabs/AboutTab.tsxAbout page (version, Whisper status, GPU)
AlignmentSettings.tsxAlignment service config
LocalWhisperSettings.tsxLocal Whisper config
CacheManagement.tsxCache management UI

📊 Data Flow Architecture

Main Data Flow

State Flow


🚀 Deployment Architecture


📝 Development Guide

Requirements

  • Node.js 18+
  • npm or yarn

Quick Start

bash
# Install dependencies
yarn install

# Web development mode
yarn dev

# Electron development mode
yarn electron:dev

# Build Electron app
yarn electron:build

Environment Variables

bash
GEMINI_API_KEY=your_gemini_key    # Required: Translation & proofreading
OPENAI_API_KEY=your_openai_key    # Optional: Online Whisper

📚 References

Released under the MIT License.