Domain
class yandex_ai_studio_sdk._speechkit.text_to_speech.function.AsyncTextToSpeechFunction
Text to Speech function for creating synthesis object which provides methods for invoking voice synthesizing.
__call__(*, loudness_normalization=Undefined, audio_format=Undefined, model=Undefined, voice=Undefined, role=Undefined, speed=Undefined, volume=Undefined, pitch_shift=Undefined, duration_ms=Undefined, duration_min_ms=Undefined, duration_max_ms=Undefined, single_chunk_mode=Undefined)
Creates TextToSpeech object with provides methods for voice synthesizing.
To learn more about parameters and their formats and possible values, refer to TTS documentation
|
Parameters |
|
|
Return type |
TTS object
class yandex_ai_studio_sdk._speechkit.text_to_speech.tts.AsyncTextToSpeech
async run(input, *, timeout=60)
Run a speech synthesis for given text and return joined result.
To change initial search settings use .configure method:
>>> search = sdk.speechkit.text_to_speech(audio_format='mp3')
>>> search = search.configure(audio_format='WAV')
|
Parameters |
|
|
Returns |
synthesis result; joined in case of >1 chunks in synthesis response. |
|
Return type |
async run_stream(input, *, timeout=60)
|
Parameters |
|
|
Return type |
class AudioFormat
classmethod Unknown(name, value)
|
Parameters |
__new__(value)
conjugate()
Returns self, the complex conjugate of any int.
bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
real
the real part of a complex number
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
denominator
the denominator of a rational number in lowest terms
classmethod PCM16(sample_rate_hertz, channels=1)
Audio bit depth 16-bit signed little-endian (Linear PCM).
|
Parameters |
|
|
Return type |
MP3 = 3
Data is encoded using MPEG-1/2 Layer III and compressed using the MP3 container format
WAV = 1
Audio bit depth 16-bit signed little-endian (Linear PCM) paked into WAV container format
OGG_OPUS = 2
Data is encoded using the OPUS audio codec and compressed using the OGG container format
__init__(*args, **kwds)
class LoudnessNormalization
classmethod Unknown(name, value)
|
Parameters |
__new__(value)
conjugate()
Returns self, the complex conjugate of any int.
bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
as_integer_ratio()
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
is_integer()
Returns True. Exists for duck type compatibility with float.is_integer.
real
the real part of a complex number
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
denominator
the denominator of a rational number in lowest terms
MAX_PEAK = 1
The type of normalization, wherein the gain is changed to bring the highest PCM sample value or analog signal peak to a given level.
LUFS = 2
The type of normalization based on EBU R 128 recommendation
__init__(*args, **kwds)
__init__(*, sdk, uri, config=None, owner=None)
|
Parameters |
|
property config: ConfigTypeT
configure(*, loudness_normalization=Undefined, audio_format=Undefined, model=Undefined, voice=Undefined, role=Undefined, speed=Undefined, volume=Undefined, pitch_shift=Undefined, duration_ms=Undefined, duration_min_ms=Undefined, duration_max_ms=Undefined, single_chunk_mode=Undefined)
Returns the new object with config fields overrode by passed values.
To return set value back to default, pass None value.
To learn more about parameters and their formats and possible values, refer to TTS documentation
|
Parameters |
|
|
Return type |
create_bistream(*, timeout=600)
Creates a bidirectional stream object for using Yandex SpeechKit Streaming synthesis.
|
Parameters |
timeout (float |
|
Return type |
property fine_tuned: bool
property uri: str
class yandex_ai_studio_sdk._speechkit.text_to_speech.tts.AsyncTTSBidirectionalStream
Bidirectional SpeechKit TTS API which allows to write requests and read synthesized result in realtime
async write(input)
Write a input to be synthesized
|
Parameters |
input (str |
|
Return type |
None |
async read()
Read chunk of synthesized result.
Returns None in case of closed stream.
|
Return type |
TextToSpeechResult | None |
async gen()
Returns generator over all synthesized result parts.
|
Return type |
async done_writing()
Close the stream to tell to a server you done writing.
Closing the stream will allow any iteration over this stream to exit.
It is very important to close the stream to properly release resources.
|
Return type |
None |
async flush()
Send message to server to force synthesis with already given input
|
Return type |
None |