txt2voice


Nametxt2voice JSON
Version 0.1.4 PyPI version JSON
download
home_pageNone
SummaryConvert text to voice
upload_time2023-08-05 08:09:37
maintainerNone
docs_urlNone
authorzemags
requires_python>=3.9
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Text to Audio SDK

[![PyPI Version][pypi-image]][pypi-url]
[![Build Status][build-image]][build-url]
[![Code Coverage][coverage-image]][coverage-url]
[![Code Quality][quality-image]][quality-url]
[![License][license-image]][license-url]

The Yandex Text to Audio SDK is a Python package that allows you to convert text to audio using Yandex premium voices. It provides an easy-to-use asynchronous interface for generating audio files from text with customizable voice, speed, and other parameters.

## Installation

You can install the SDK from PyPI using pip:

```bash
pip install txt2voice
```

## Quick Start

Here's a simple example demonstrating how to use the SDK to convert text to audio:

```python
import asyncio

from txt2voice.api import TextToVoice, RequestParams
from txt2voice.models import VoiceParams, SpeedParams, AudioContent


async def main():
    token = 'YOUR_IAM_TOKEN'
    folder_id = 'YOUR_FOLDER_ID'
    text = 'Hello, this is an example text for audio conversion!'
    output_file = 'output_audio.mp3'

    api = TextToVoice(url='https://tts.api.cloud.yandex.net/speech/v1/tts:synthesize')

    convert_params = RequestParams(
        voice=VoiceParams(male='fillip', female='alyona'),
        speed=SpeedParams(speed=1.0),
        path_to_audiofiles=output_file,
        folder_id=folder_id,
        iam_token=token,
        lang='ru-RU',
        text=text
    )

    audio_content: AudioContent = await api.request_audio_content(convert_params)
    api.convert_ogg_to_mp3(audio_content, 'output_audio.mp3')


if __name__ == '__main__':
    asyncio.run(main())
```

## Dependencies

The Yandex Text to Audio SDK has the following dependencies:

- aiohttp
- pydantic
- pydub

You can install them using pip with the following command:

```bash
pip install aiohttp pydantic pydub
```

## Contributing

Contributions to the project are welcome! If you find a bug, have a feature request, or want to contribute code, please open an issue or submit a pull request.

## License

This SDK is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

Happy audio conversion with Yandex Text to Audio SDK!

<!-- Badges -->

[pypi-image]: https://img.shields.io/pypi/v/txt2voice
[pypi-url]: https://pypi.org/project/txt2voice/
[build-image]: https://github.com/zemags/python-yandex-speech-kit/actions/workflows/build.yml/badge.svg
[build-url]: https://github.com/zemags/python-yandex-speech-kit/actions/workflows/build.yml
[coverage-image]: https://codecov.io/gh/zemags/python-yandex-speech-kit/branch/main/graph/badge.svg
[coverage-url]: https://codecov.io/gh/zemags/python-yandex-speech-kit
[quality-image]: https://api.codeclimate.com/v1/badges/d36533b74a159ebe78b1/maintainability
[quality-url]: https://codeclimate.com/github/zemags/python-yandex-speech-kit
[license-image]: https://img.shields.io/badge/License-MIT-yellow.svg
[license-url]: https://opensource.org/licenses/MIT
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "txt2voice",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "zemags",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/65/70/762f984dd51ee216bdac6d990efc55a242679486ff32af64fc11fffc92a9/txt2voice-0.1.4.tar.gz",
    "platform": null,
    "description": "# Text to Audio SDK\n\n[![PyPI Version][pypi-image]][pypi-url]\n[![Build Status][build-image]][build-url]\n[![Code Coverage][coverage-image]][coverage-url]\n[![Code Quality][quality-image]][quality-url]\n[![License][license-image]][license-url]\n\nThe Yandex Text to Audio SDK is a Python package that allows you to convert text to audio using Yandex premium voices. It provides an easy-to-use asynchronous interface for generating audio files from text with customizable voice, speed, and other parameters.\n\n## Installation\n\nYou can install the SDK from PyPI using pip:\n\n```bash\npip install txt2voice\n```\n\n## Quick Start\n\nHere's a simple example demonstrating how to use the SDK to convert text to audio:\n\n```python\nimport asyncio\n\nfrom txt2voice.api import TextToVoice, RequestParams\nfrom txt2voice.models import VoiceParams, SpeedParams, AudioContent\n\n\nasync def main():\n    token = 'YOUR_IAM_TOKEN'\n    folder_id = 'YOUR_FOLDER_ID'\n    text = 'Hello, this is an example text for audio conversion!'\n    output_file = 'output_audio.mp3'\n\n    api = TextToVoice(url='https://tts.api.cloud.yandex.net/speech/v1/tts:synthesize')\n\n    convert_params = RequestParams(\n        voice=VoiceParams(male='fillip', female='alyona'),\n        speed=SpeedParams(speed=1.0),\n        path_to_audiofiles=output_file,\n        folder_id=folder_id,\n        iam_token=token,\n        lang='ru-RU',\n        text=text\n    )\n\n    audio_content: AudioContent = await api.request_audio_content(convert_params)\n    api.convert_ogg_to_mp3(audio_content, 'output_audio.mp3')\n\n\nif __name__ == '__main__':\n    asyncio.run(main())\n```\n\n## Dependencies\n\nThe Yandex Text to Audio SDK has the following dependencies:\n\n- aiohttp\n- pydantic\n- pydub\n\nYou can install them using pip with the following command:\n\n```bash\npip install aiohttp pydantic pydub\n```\n\n## Contributing\n\nContributions to the project are welcome! If you find a bug, have a feature request, or want to contribute code, please open an issue or submit a pull request.\n\n## License\n\nThis SDK is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\nHappy audio conversion with Yandex Text to Audio SDK!\n\n<!-- Badges -->\n\n[pypi-image]: https://img.shields.io/pypi/v/txt2voice\n[pypi-url]: https://pypi.org/project/txt2voice/\n[build-image]: https://github.com/zemags/python-yandex-speech-kit/actions/workflows/build.yml/badge.svg\n[build-url]: https://github.com/zemags/python-yandex-speech-kit/actions/workflows/build.yml\n[coverage-image]: https://codecov.io/gh/zemags/python-yandex-speech-kit/branch/main/graph/badge.svg\n[coverage-url]: https://codecov.io/gh/zemags/python-yandex-speech-kit\n[quality-image]: https://api.codeclimate.com/v1/badges/d36533b74a159ebe78b1/maintainability\n[quality-url]: https://codeclimate.com/github/zemags/python-yandex-speech-kit\n[license-image]: https://img.shields.io/badge/License-MIT-yellow.svg\n[license-url]: https://opensource.org/licenses/MIT",
    "bugtrack_url": null,
    "license": null,
    "summary": "Convert text to voice",
    "version": "0.1.4",
    "project_urls": {
        "Home": "https://github.com/zemags/python-yandex-speech-kit"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "10806acd9c0f7ec9313c7a233f4a69371d4940c6c06cdc976c8ce48654576021",
                "md5": "356b52d8ad86dfc2ee8ee706f7a72a58",
                "sha256": "3a44a94615cacae321dd258539b6c8d3ecc1f4228fd2df3a26ae026406ab6850"
            },
            "downloads": -1,
            "filename": "txt2voice-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "356b52d8ad86dfc2ee8ee706f7a72a58",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 4760,
            "upload_time": "2023-08-05T08:09:35",
            "upload_time_iso_8601": "2023-08-05T08:09:35.781257Z",
            "url": "https://files.pythonhosted.org/packages/10/80/6acd9c0f7ec9313c7a233f4a69371d4940c6c06cdc976c8ce48654576021/txt2voice-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6570762f984dd51ee216bdac6d990efc55a242679486ff32af64fc11fffc92a9",
                "md5": "6af193745163ab3203c4a30dd5b03b52",
                "sha256": "eeaedb8d9ef477ef0511f509b2260eb6f2c56a2b37d048b7087af5146018ffe3"
            },
            "downloads": -1,
            "filename": "txt2voice-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "6af193745163ab3203c4a30dd5b03b52",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 7385,
            "upload_time": "2023-08-05T08:09:37",
            "upload_time_iso_8601": "2023-08-05T08:09:37.526542Z",
            "url": "https://files.pythonhosted.org/packages/65/70/762f984dd51ee216bdac6d990efc55a242679486ff32af64fc11fffc92a9/txt2voice-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-05 08:09:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "zemags",
    "github_project": "python-yandex-speech-kit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "txt2voice"
}
        
Elapsed time: 0.18305s