# yoshi-782/aivoicectrl architecture

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

- Interactive diagram: https://gitdiagram.com/yoshi-782/aivoicectrl
- Repository: https://github.com/yoshi-782/aivoicectrl

## Overview

##### Main Components
- User/Caller – This represents the command-line or any external application invoking the script.
- AIVoiceCtrl Package – This is the core of the project. Within it, the primary component is the AIVoiceCtrl class (found in AIVoiceCtrl.py). This class is responsible for:
- Initializing connections with the A.I.VOICE Editor.
- Changing voice presets.
- Reading (playing) text aloud.
- External Dependencies:
- A.I.VOICE Editor – The external application that the Python module controls.
- Windows 10 Environment – The operating system environment necessary for the editor.
- pythonnet Library – Provides the bridge between Python and the .NET libraries required to interface with the A.I.VOICE Editor.

##### Relationships and Interactions
- The User/CLI inputs a command (e.g., “読み上げテスト”) that is passed to the Python script.
- The AIVoiceCtrl class is instantiated and used to:
- Retrieve the list of available voice presets.
- Change to a selected preset.
- Issue commands for text-to-speech functionalities.

##### Architectural Patterns and Principles
- Modularity: The system is separated into a single Python package, which makes it straightforward and encapsulated.
- Abstraction: The AIVoiceCtrl class abstracts the complexities of interacting with a .NET-based editor from the Python side.
- External Integration: Emphasizing how the project integrates with both an external Windows application and a bridging library (pythonnet).

##### Relevant Technologies and Frameworks
- Python (Version 3.9.7) is the core language.
- pythonnet is essential to bridge Python with .NET libraries.
- Windows 10 and A.I.VOICE Editor (Version 1.3.0.0) are key external components.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "User Layer"
        USER["User/CLI"]:::external
    end

    subgraph "Python Module"
        AIPKG["AIVoiceCtrl Package"]:::internal
        AICLASS["AIVoiceCtrl Class"]:::internal
    end

    subgraph "External Environment"
        WIN["Windows 10 Environment"]:::external
        EDITOR["A.I.VOICE Editor (v1.3.0.0)"]:::external
        PYNET["pythonnet Library"]:::bridge
    end

    USER -->|"command"| AIPKG
    AIPKG -->|"instantiates"| AICLASS
    AICLASS -->|"callsMethods"| EDITOR
    AICLASS -->|"dependsOn"| PYNET
    PYNET -->|"bridgesTo"| EDITOR
    AIPKG ---|"runsOn"| WIN
    EDITOR ---|"runsOn"| WIN
    PYNET ---|"compatibleWith"| WIN

    click AIPKG "https://github.com/yoshi-782/aivoicectrl/tree/main/aivoiceCtrl/"
    click AICLASS "https://github.com/yoshi-782/aivoicectrl/blob/main/aivoiceCtrl/AIVoiceCtrl.py"

    classDef internal fill:#b3e6b3,stroke:#333,stroke-width:2px;
    classDef external fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef bridge fill:#ffdd99,stroke:#333,stroke-width:2px;
```
