Skip to content

Commit

Permalink
Pypi 1.4.0 build
Browse files Browse the repository at this point in the history
  • Loading branch information
tikhonp committed Jul 26, 2021
1 parent faaa6ab commit e587071
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
41 changes: 23 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

Python SDK for Yandex Speechkit API.

For more information please visit [Yandex Speechkit API Docs](https://cloud.yandex.com/en/docs/speechkit/).
This lib supports short and long audio recognition of
speechkit
For more information please visit [Yandex Speechkit API Docs](https://cloud.yandex.com/en/docs/speechkit/). This lib
supports short and long audio recognition of speechkit

# Getting Started

Assuming that you have Python and `virtualenv` installed, set up your environment and install the required dependencies like this, or you can install the library using `pip`:
Assuming that you have Python and `virtualenv` installed, set up your environment and install the required dependencies
like this, or you can install the library using `pip`:

```bash
$ git clone https://github.com/TikhonP/yandex-speechkit-lib-python.git
Expand All @@ -21,47 +21,52 @@ $ . venv/bin/activate
$ python -m pip install -r requirements.txt
$ python -m pip install .
```

```bash
python -m pip install speechkit
```

## Using speechkit
## Using speechkit

There are support of recognizing long and short audio and synthesis. For more information please read docs below.
There are support of recognizing long and short audio and synthesis. For more information please read docs below.

#### For short audio

From a Python interpreter:

```python3
>>> import speechkit
>>> recognizeShortAudio = speechkit.RecognizeShortAudio('<yandex_passport_oauth_token>')
>>> with open('/Users/tikhon/Desktop/out.wav', 'rb') as f:
... data = f.read()
...
>>> recognizeShortAudio.recognize(data, folderId='<folder _id>', format='lpcm', sampleRateHertz='48000')
import speechkit

recognizeShortAudio = speechkit.RecognizeShortAudio(str('<yandex_passport_oauth_token>'))
with open('/Users/tikhon/Desktop/out.wav', 'rb') as f:
data = f.read()

print(recognizeShortAudio.recognize(data, folderId='<folder _id>', format='lpcm', sampleRateHertz='48000'))

'Текст который нужно распознать'
```

#### For synthesis

```python3
>>> import speechkit
>>> synthesizeAudio = speechkit.SynthesizeAudio('<yandex_passport_oauth_token>')
>>> synthesizeAudio.synthesize('/Users/tikhon/Desktop/out.wav', text='Текст который нужно синтезировать', voice='oksana', format='lpcm', sampleRateHertz='16000', folderId='<folder _id>')
import speechkit

synthesizeAudio = speechkit.SynthesizeAudio(str('<yandex_passport_oauth_token>'))
synthesizeAudio.synthesize(str('/Users/tikhon/Desktop/out.wav'), text='Текст который нужно синтезировать',
voice='oksana', format='lpcm', sampleRateHertz='16000', folderId='<folder _id>')
```

#### For long audio

See [long_audio_recognition.py](examples/long_audio_recognition.py)
See [long_audio_recognition.py](https://github.com/TikhonP/yandex-speechkit-lib-python/blob/master/examples/long_audio_recognition.py)

# Speechkit documentation

See [speechkit docs](DOCS.md) for more info.
See [speechkit docs](https://github.com/TikhonP/yandex-speechkit-lib-python/blob/master/DOCS.md) for more info.

# Todo

-
-

# License

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = speechkit
version = 1.4.0
author = Tikhon Petrishchev
author_email = [email protected]
description = It's lib for using speechkit api by yandex.
description = Python SDK for Yandex Speechkit API.
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/TikhonP/yandex-speechkit-lib-python
Expand Down

0 comments on commit e587071

Please sign in to comment.