Skip to main content

A library for Yandex speech kit

Project description

============================
yandex_speech
============================

Generation of speech using `Yandex SpeechKit
<https://tech.yandex.ru/speechkit/>`_.
SpeechKit Cloud allows you to voice any text in Russian or English.
You can choose the voice (male or female), tempo and intonation (e.g., joy).

.. image:: https://badge.fury.io/py/yandex_speech.svg
:target: https://badge.fury.io/py/yandex_speech

.. image:: https://travis-ci.org/art1415926535/Yandex_speech.svg?branch=master
:target: https://travis-ci.org/art1415926535/Yandex_speech

.. image:: https://landscape.io/github/art1415926535/Yandex_speech/master/landscape.svg?style=flat
:target: https://landscape.io/github/art1415926535/Yandex_speech/master

Installation
------------
Use ``Pip``, Luke

.. code-block:: bash

$ pip install yandex_speech

Usage
-----
.. code-block:: python

from yandex_speech import TTS
tts = TTS("jane", "mp3", "60589d42-0e42-b742-8942-thekeyisalie")
tts.generate("Привет мир")
tss.save()

TTS(speaker, audio_format, key, lang="ru‑RU", emotion="neutral", speed=1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*Required parameters:*

- ``speaker`` - Speaker. Female: "jane", "oksana", "alyss", "omazh". Male: "zahar", "ermil";
- ``audio_format`` - Audio file format: "mp3", "wav", "opus";
- ``key`` - `API‑key for Yandex speech kit<https://developer.tech.yandex.ru>`_.

*Optional parameters:*

- ``lang`` - Language: "ru‑RU" (by default), "en-US", "tr-TR", "uk-UK";
- ``emotion`` - The color of the voice: "neutral" (by default), "evil", "good";
- ``speed`` - Speech tempo: a value between 0.1 (slowest) to 3.0 (fastest).


tts.generate(text)
~~~~~~~~~~~~~~~~~~~~~~~
- ``text`` - Text to speech: "з+амок" (before the stressed vowel can be put "+"; the restriction on line length: 2000 bytes);

tts.save(path="speech")
~~~~~~~~~~~~~~~~~~~~~~~
- ``path`` (optional) - A path to save file: "test", "dirname/test.mp3", ...;
Returns the path.

References
----------
`SpeechKit Cloud API
<https://tech.yandex.ru/speechkit/cloud/doc/intro/overview/concepts/about-docpage/>`_

`Overview technology
<https://tech.yandex.ru/speechkit/cloud/doc/dg/concepts/speechkit-dg-overview-technology-tts-docpage/>`_

`The format of request and response
<https://tech.yandex.ru/speechkit/cloud/doc/dg/concepts/speechkit-dg-tts-docpage/>`_

`SpeechKit Key
<https://developer.tech.yandex.ru>`_

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yandex_speech-0.3.1.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file yandex_speech-0.3.1.tar.gz.

File metadata

  • Download URL: yandex_speech-0.3.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for yandex_speech-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b3f9ebf3bdcd64fd06a68db7ca4ec0825fd81e4f8a96ed43542b02d3a601e42e
MD5 0d651e9f22d2511392cb26f4b26fa54b
BLAKE2b-256 6a2df642e6653c46ef4b88a03c9d773bb417d65b5e605045e1b8e673205fcf63

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page