# akazdayo/autoyukkuri architecture

> Architecture diagram of the GitHub repository akazdayo/autoyukkuri, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akazdayo/autoyukkuri
- Repository: https://github.com/akazdayo/autoyukkuri

## Overview

Key Components to Include:

##### Input/Output Processing Layer
- Input: Raw voice commentary video files (MP4)
- Output: YMM4 project files
- Sample directory connection

##### Core Processing Pipeline
- Voice Recognition Module (using Whisper AI)
- Text Processing Module
- YMM4 Project Generation Module

##### Configuration Management
- Default settings storage (default directory)
- Project configuration (project.json)
- Character configuration (chara.json)
- Items configuration (items.json)

##### Utility Components
- GUI/Popup interface (utils/popup.py)
- Testing framework (src/tests)

##### Main Flow (Top to Bottom)
- [Input Video] → [Voice Recognition] → [Text Processing] → [YMM4 Project Generation] → [Output Project]

##### Component Relationships
- Blue: Input/Output components
- Green: Processing components
- Yellow: Configuration components
- Gray: Utility components

##### Specific Implementation Details
- Relationship between src/app.py (main application) and other modules
- Clustering.py component for voice processing
- Generate.py module for project generation
- How hatsuon.py integrates for pronunciation processing
- Player.py's role in media handling

##### Technical Stack Indicators
- Python 3.8-3.11 runtime environment
- FFmpeg dependency
- Whisper AI integration
- GPU acceleration support (optional)

##### Configuration Flow
- [Default Configs] → [Runtime Settings] → [Processing Pipeline]

Key Architectural Considerations:

##### Modular Design
- Clear separation between core processing modules
- Configuration injection points
- Test coverage scope

##### Processing Pipeline
- Linear transformation flow
- Error handling paths
- Where user intervention points exist

##### Resource Management
- GPU/CPU processing paths
- Cache storage locations
- Temporary file handling

Use the following symbols:
- Rectangles: Processing modules
- Hexagons: Input/Output points
- Diamonds: Decision points
- Clouds: External services/dependencies

Remember to:
- Keep the main processing flow clear and central
- Configuration dependencies on the side
- Version information for critical dependencies
- Optional components (like GPU support)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph IO["Input/Output Layer"]
        Input[("Input Video")]:::input
        Output[("Output YMM4")]:::output
        SampleIn["Sample Input"]:::file
        SampleOut["Sample Output"]:::file
        ExportOut["Export Directory"]:::file
    end

    subgraph Core["Core Processing Pipeline"]
        VoiceRec["Voice Recognition\n(Whisper AI)"]:::process
        TextProc["Text Processing"]:::process
        YMMGen["YMM4 Generation"]:::process
        
        subgraph Components["Core Components"]
            App["Main Application"]:::component
            Cluster["Voice Processing"]:::component
            Generate["Project Generator"]:::component
            Hatsuon["Pronunciation"]:::component
            Player["Media Player"]:::component
            Run["Runtime Controller"]:::component
            Status["Status Manager"]:::component
        end
    end

    subgraph Config["Configuration Layer"]
        CharaConfig["Character Config"]:::config
        ItemsConfig["Items Config"]:::config
        ProjConfig["Project Config"]:::config
    end

    subgraph Utils["Utility Layer"]
        GUI["GUI/Popup Interface"]:::util
        Tests["Testing Framework"]:::util
        Install["Installation"]:::util
        Deps["Dependencies"]:::util
    end

    %% Main Flow
    Input --> VoiceRec
    VoiceRec --> TextProc
    TextProc --> YMMGen
    YMMGen --> Output

    %% Component Connections
    App --> VoiceRec
    Cluster --> VoiceRec
    Generate --> YMMGen
    Hatsuon --> TextProc
    Player --> Input
    Run --> App
    Status --> Core

    %% Configuration Dependencies
    CharaConfig -.-> Core
    ItemsConfig -.-> Core
    ProjConfig -.-> Core

    %% Sample Connections
    SampleIn -.-> Input
    Output -.-> SampleOut
    Output -.-> ExportOut

    %% Click Events
    click SampleIn "https://github.com/akazdayo/autoyukkuri/blob/main/Sample/base.mp4"
    click SampleOut "https://github.com/akazdayo/autoyukkuri/blob/main/Sample/converted.mp4"
    click ExportOut "https://github.com/akazdayo/autoyukkuri/blob/main/export/Sample.ymmp"
    click App "https://github.com/akazdayo/autoyukkuri/blob/main/src/app.py"
    click Cluster "https://github.com/akazdayo/autoyukkuri/blob/main/src/clustering.py"
    click Generate "https://github.com/akazdayo/autoyukkuri/blob/main/src/generate.py"
    click Hatsuon "https://github.com/akazdayo/autoyukkuri/blob/main/src/hatsuon.py"
    click Player "https://github.com/akazdayo/autoyukkuri/blob/main/src/player.py"
    click Run "https://github.com/akazdayo/autoyukkuri/blob/main/src/run.py"
    click Status "https://github.com/akazdayo/autoyukkuri/blob/main/src/status.py"
    click CharaConfig "https://github.com/akazdayo/autoyukkuri/blob/main/default/chara.json"
    click ItemsConfig "https://github.com/akazdayo/autoyukkuri/blob/main/default/items.json"
    click ProjConfig "https://github.com/akazdayo/autoyukkuri/blob/main/default/project.json"
    click GUI "https://github.com/akazdayo/autoyukkuri/blob/main/utils/popup.py"
    click Tests "https://github.com/akazdayo/autoyukkuri/tree/main/src/tests"
    click Install "https://github.com/akazdayo/autoyukkuri/blob/main/install.py"
    click Deps "https://github.com/akazdayo/autoyukkuri/blob/main/requirements.txt"

    %% Styling
    classDef input fill:#2374ab
    classDef output fill:#2374ab
    classDef process fill:#57a773
    classDef component fill:#57a773,stroke-dasharray: 5 5
    classDef config fill:#ffc857
    classDef util fill:#929292
    classDef file fill:#d1d1d1,stroke-dasharray: 3 3
```
