aivoice-python


Nameaivoice-python JSON
Version 0.1.5 PyPI version JSON
download
home_pageNone
SummaryA Python wrapper for A.I.VOICE Editor API
upload_time2025-07-08 16:54:25
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords aivoice tts text-to-speech voice-synthesis
VCS
bugtrack_url
requirements pythonnet typing-extensions build twine
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # A.I.VOICE Python Library

A Python wrapper for A.I.VOICE Editor API that makes it easy to control A.I.VOICE Editor from Python.

## Features

✨ **Easy to use**: Simple Python interface for A.I.VOICE Editor API  
🎵 **Voice synthesis**: Generate speech from text using A.I.VOICE voices  
🔧 **Full control**: Access to all A.I.VOICE Editor functions  
🛡️ **Type safety**: Full type hints for better development experience  

## Requirements

- Windows OS
- A.I.VOICE Editor (v1.3.0 or later)
- Python 3.8+
- pythonnet

## Installation

```bash
pip install aivoice-python
```

## Quick Start

```python
import time
from aivoice_python import AIVoiceTTsControl, HostStatus

# Create A.I.VOICE controller (using default installation path)
tts_control = AIVoiceTTsControl()

# Or specify custom installation path:
# tts_control = AIVoiceTTsControl(editor_dir="C:\\MyPath\\AIVoice\\AIVoiceEditor\\")

# Initialize API
host_name = tts_control.get_available_host_names()[0]
tts_control.initialize(host_name)

# Start A.I.VOICE Editor if not running
if tts_control.status == HostStatus.NotRunning:
    tts_control.start_host()

# Connect to A.I.VOICE Editor
tts_control.connect()

# Set text and play
tts_control.text = "Hello, A.I.VOICE!"
play_time = tts_control.get_play_time()
tts_control.play()

# Wait for playback to complete
time.sleep((play_time + 500) / 1000)

# Disconnect
tts_control.disconnect()
```

## API Reference

### AIVoiceTTsControl

Main class for controlling A.I.VOICE Editor.

#### Constructor

- `AIVoiceTTsControl(editor_dir: str = None)` - Create controller instance
  - `editor_dir`: Custom A.I.VOICE Editor installation path (optional)

#### Properties

- `text: str` - Text to synthesize
- `current_voice_preset_name: str` - Current voice preset name
- `voice_names: List[str]` - Available voice names
- `voice_preset_names: List[str]` - Available voice preset names
- `status: HostStatus` - Current host status
- `version: str` - Host version

#### Methods

- `initialize(service_name: str)` - Initialize API
- `connect()` - Connect to A.I.VOICE Editor
- `disconnect()` - Disconnect from A.I.VOICE Editor
- `start_host()` - Start A.I.VOICE Editor
- `play()` - Start/pause playback
- `stop()` - Stop playback
- `get_play_time() -> int` - Get playback duration in milliseconds
- `save_audio_to_file(path: str)` - Save audio to file

### Enums

#### HostStatus
- `NotRunning` - A.I.VOICE Editor is not running
- `NotConnected` - Not connected to A.I.VOICE Editor
- `Idle` - Connected and idle
- `Busy` - Connected and busy

#### TextEditMode
- `Text` - Text mode
- `List` - List mode

## Examples

### Custom Installation Path

If A.I.VOICE Editor is installed in a non-standard location:

```python
from aivoice_python import AIVoiceTTsControl

# Specify custom installation path
tts_control = AIVoiceTTsControl(editor_dir="D:\\MyApps\\AIVoice\\AIVoiceEditor\\")
# ... rest of the code ...
```

### Save Audio to File

```python
from aivoice_python import AIVoiceTTsControl

tts_control = AIVoiceTTsControl()
# ... initialization code ...

tts_control.text = "Hello, World!"
tts_control.save_audio_to_file("output.wav")
```

### Use Different Voice

```python
from aivoice_python import AIVoiceTTsControl

tts_control = AIVoiceTTsControl()
# ... initialization code ...

# Get available voices
voices = tts_control.voice_names
print(f"Available voices: {voices}")

# Set voice
if voices:
    tts_control.current_voice_preset_name = voices[1]  # Use second voice
```

## Error Handling

```python
from aivoice_python import AIVoiceTTsControl

try:
    tts_control = AIVoiceTTsControl()
except FileNotFoundError as e:
    print(f"A.I.VOICE Editor not found: {e}")
    # Try with custom path
    try:
        tts_control = AIVoiceTTsControl(editor_dir="C:\\MyPath\\AIVoice\\AIVoiceEditor\\")
    except FileNotFoundError:
        print("Please install A.I.VOICE Editor v1.3.0 or later.")
```

## License

MIT License

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## Support

If you encounter any issues, please create an issue on the GitHub repository.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "aivoice-python",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "aivoice, tts, text-to-speech, voice-synthesis",
    "author": null,
    "author_email": "yupix <yupi0982@outlook.jp>",
    "download_url": "https://files.pythonhosted.org/packages/dd/3f/0efc9f622268cb0fcad0867a11e00052a69e00797b3a4201eb4baab1aa34/aivoice_python-0.1.5.tar.gz",
    "platform": null,
    "description": "# A.I.VOICE Python Library\r\n\r\nA Python wrapper for A.I.VOICE Editor API that makes it easy to control A.I.VOICE Editor from Python.\r\n\r\n## Features\r\n\r\n\u2728 **Easy to use**: Simple Python interface for A.I.VOICE Editor API  \r\n\ud83c\udfb5 **Voice synthesis**: Generate speech from text using A.I.VOICE voices  \r\n\ud83d\udd27 **Full control**: Access to all A.I.VOICE Editor functions  \r\n\ud83d\udee1\ufe0f **Type safety**: Full type hints for better development experience  \r\n\r\n## Requirements\r\n\r\n- Windows OS\r\n- A.I.VOICE Editor (v1.3.0 or later)\r\n- Python 3.8+\r\n- pythonnet\r\n\r\n## Installation\r\n\r\n```bash\r\npip install aivoice-python\r\n```\r\n\r\n## Quick Start\r\n\r\n```python\r\nimport time\r\nfrom aivoice_python import AIVoiceTTsControl, HostStatus\r\n\r\n# Create A.I.VOICE controller (using default installation path)\r\ntts_control = AIVoiceTTsControl()\r\n\r\n# Or specify custom installation path:\r\n# tts_control = AIVoiceTTsControl(editor_dir=\"C:\\\\MyPath\\\\AIVoice\\\\AIVoiceEditor\\\\\")\r\n\r\n# Initialize API\r\nhost_name = tts_control.get_available_host_names()[0]\r\ntts_control.initialize(host_name)\r\n\r\n# Start A.I.VOICE Editor if not running\r\nif tts_control.status == HostStatus.NotRunning:\r\n    tts_control.start_host()\r\n\r\n# Connect to A.I.VOICE Editor\r\ntts_control.connect()\r\n\r\n# Set text and play\r\ntts_control.text = \"Hello, A.I.VOICE!\"\r\nplay_time = tts_control.get_play_time()\r\ntts_control.play()\r\n\r\n# Wait for playback to complete\r\ntime.sleep((play_time + 500) / 1000)\r\n\r\n# Disconnect\r\ntts_control.disconnect()\r\n```\r\n\r\n## API Reference\r\n\r\n### AIVoiceTTsControl\r\n\r\nMain class for controlling A.I.VOICE Editor.\r\n\r\n#### Constructor\r\n\r\n- `AIVoiceTTsControl(editor_dir: str = None)` - Create controller instance\r\n  - `editor_dir`: Custom A.I.VOICE Editor installation path (optional)\r\n\r\n#### Properties\r\n\r\n- `text: str` - Text to synthesize\r\n- `current_voice_preset_name: str` - Current voice preset name\r\n- `voice_names: List[str]` - Available voice names\r\n- `voice_preset_names: List[str]` - Available voice preset names\r\n- `status: HostStatus` - Current host status\r\n- `version: str` - Host version\r\n\r\n#### Methods\r\n\r\n- `initialize(service_name: str)` - Initialize API\r\n- `connect()` - Connect to A.I.VOICE Editor\r\n- `disconnect()` - Disconnect from A.I.VOICE Editor\r\n- `start_host()` - Start A.I.VOICE Editor\r\n- `play()` - Start/pause playback\r\n- `stop()` - Stop playback\r\n- `get_play_time() -> int` - Get playback duration in milliseconds\r\n- `save_audio_to_file(path: str)` - Save audio to file\r\n\r\n### Enums\r\n\r\n#### HostStatus\r\n- `NotRunning` - A.I.VOICE Editor is not running\r\n- `NotConnected` - Not connected to A.I.VOICE Editor\r\n- `Idle` - Connected and idle\r\n- `Busy` - Connected and busy\r\n\r\n#### TextEditMode\r\n- `Text` - Text mode\r\n- `List` - List mode\r\n\r\n## Examples\r\n\r\n### Custom Installation Path\r\n\r\nIf A.I.VOICE Editor is installed in a non-standard location:\r\n\r\n```python\r\nfrom aivoice_python import AIVoiceTTsControl\r\n\r\n# Specify custom installation path\r\ntts_control = AIVoiceTTsControl(editor_dir=\"D:\\\\MyApps\\\\AIVoice\\\\AIVoiceEditor\\\\\")\r\n# ... rest of the code ...\r\n```\r\n\r\n### Save Audio to File\r\n\r\n```python\r\nfrom aivoice_python import AIVoiceTTsControl\r\n\r\ntts_control = AIVoiceTTsControl()\r\n# ... initialization code ...\r\n\r\ntts_control.text = \"Hello, World!\"\r\ntts_control.save_audio_to_file(\"output.wav\")\r\n```\r\n\r\n### Use Different Voice\r\n\r\n```python\r\nfrom aivoice_python import AIVoiceTTsControl\r\n\r\ntts_control = AIVoiceTTsControl()\r\n# ... initialization code ...\r\n\r\n# Get available voices\r\nvoices = tts_control.voice_names\r\nprint(f\"Available voices: {voices}\")\r\n\r\n# Set voice\r\nif voices:\r\n    tts_control.current_voice_preset_name = voices[1]  # Use second voice\r\n```\r\n\r\n## Error Handling\r\n\r\n```python\r\nfrom aivoice_python import AIVoiceTTsControl\r\n\r\ntry:\r\n    tts_control = AIVoiceTTsControl()\r\nexcept FileNotFoundError as e:\r\n    print(f\"A.I.VOICE Editor not found: {e}\")\r\n    # Try with custom path\r\n    try:\r\n        tts_control = AIVoiceTTsControl(editor_dir=\"C:\\\\MyPath\\\\AIVoice\\\\AIVoiceEditor\\\\\")\r\n    except FileNotFoundError:\r\n        print(\"Please install A.I.VOICE Editor v1.3.0 or later.\")\r\n```\r\n\r\n## License\r\n\r\nMIT License\r\n\r\n## Contributing\r\n\r\nContributions are welcome! Please feel free to submit a Pull Request.\r\n\r\n## Support\r\n\r\nIf you encounter any issues, please create an issue on the GitHub repository.\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python wrapper for A.I.VOICE Editor API",
    "version": "0.1.5",
    "project_urls": {
        "Bug Tracker": "https://github.com/yupix/aivoice-python/issues",
        "Documentation": "https://github.com/yupix/aivoice-python#readme",
        "Homepage": "https://github.com/yupix/aivoice-python",
        "Repository": "https://github.com/yupix/aivoice-python"
    },
    "split_keywords": [
        "aivoice",
        " tts",
        " text-to-speech",
        " voice-synthesis"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "99b59fa160d30a63cbe30c5cc65e3d795546d8cfb4264e2074ab6beabfc8d8e0",
                "md5": "e98107e94156fa4c660ca504f0423da7",
                "sha256": "c05443775f86f41921090d495f555066f2320f2545f9f15468cd37611e46e6d4"
            },
            "downloads": -1,
            "filename": "aivoice_python-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e98107e94156fa4c660ca504f0423da7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 8359,
            "upload_time": "2025-07-08T16:54:23",
            "upload_time_iso_8601": "2025-07-08T16:54:23.168477Z",
            "url": "https://files.pythonhosted.org/packages/99/b5/9fa160d30a63cbe30c5cc65e3d795546d8cfb4264e2074ab6beabfc8d8e0/aivoice_python-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "dd3f0efc9f622268cb0fcad0867a11e00052a69e00797b3a4201eb4baab1aa34",
                "md5": "da61eb8268c5b7d15b01f42ddc2470b6",
                "sha256": "7ddcdd1343587e21e816abb17543e0b8c76f1b8eb9d15674bbc0337996afa4e5"
            },
            "downloads": -1,
            "filename": "aivoice_python-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "da61eb8268c5b7d15b01f42ddc2470b6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 9649,
            "upload_time": "2025-07-08T16:54:25",
            "upload_time_iso_8601": "2025-07-08T16:54:25.881688Z",
            "url": "https://files.pythonhosted.org/packages/dd/3f/0efc9f622268cb0fcad0867a11e00052a69e00797b3a4201eb4baab1aa34/aivoice_python-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-08 16:54:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yupix",
    "github_project": "aivoice-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "pythonnet",
            "specs": [
                [
                    ">=",
                    "3.0.0"
                ]
            ]
        },
        {
            "name": "typing-extensions",
            "specs": [
                [
                    ">=",
                    "4.0.0"
                ]
            ]
        },
        {
            "name": "build",
            "specs": [
                [
                    ">=",
                    "0.8.0"
                ]
            ]
        },
        {
            "name": "twine",
            "specs": [
                [
                    ">=",
                    "4.0.0"
                ]
            ]
        }
    ],
    "lcname": "aivoice-python"
}
        
Elapsed time: 2.24119s