Skip to main content

SpeechKit package

Project description

Getting started

Installation

pip install yandex-speechkit

Setting up credentials

from speechkit import configure_credentials, creds

configure_credentials(
    yandex_credentials=creds.YandexCredentials(
        api_key='...'
    )
)

Using speech-to-text model

from speechkit import model_repository
from speechkit.stt import AudioProcessingType

model = model_repository.recognition_model()

model.audio_processing_type = AudioProcessingType.Full
model.language = 'en-US'

result = model.transcribe_file('path/to/audio')
for c, res in enumerate(result):
    print(f'channel: {c}\nraw_text: {res.raw_text}\nnorm_text: {res.normalized_text}\n')

Using text-to-speech model

from speechkit import model_repository

model = model_repository.synthesis_model()

model.voice = 'john'

result = model.synthesize('Hello, world!', raw_format=False)
result.export('path/to/audio', format='wav')

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

yandex_speechkit-1.1-py3-none-any.whl (105.8 kB view hashes)

Uploaded Python 3

Supported by

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