Vocalizer class
ru.yandex.speechkit
public class Vocalizer
Class for single sessions of speech synthesis.
Vocalizer is responsible for sending text to the server and vocalizing synthesized speech. For event notification, Vocalizer uses the VocalizerListener interface.
Nested classes
class | Vocalizer.Language |
class | Vocalizer.Voice |
class | Vocalizer.Language |
class | Vocalizer.Voice |
Methods
void | cancel() | Interrupts the process of speech synthesis and vocalizing the synthesized speech. |
Vocalizer | createVocalizer(String language, String text, boolean autoPlay) | Creates a single-use object that performs text vocalization (using the voice JANE). |
Vocalizer | createVocalizer(String language, String text, boolean autoPlay, String voice) | Creates a single-use object that performs text vocalization using the selected voice. |
String | getVersion() | Returns the library version. |
void | play() | Launches the speech synthesis process. |
void | setListener(VocalizerListener listener) | Specifies the object that will be passed messages about speech synthesis events. |
void | start() | Launches the speech synthesis process. |
void | cancel() | Interrupts the process of speech synthesis and vocalizing the synthesized speech. |
Vocalizer | createVocalizer(String language, String text, boolean autoPlay) | Creates a single-use object that performs text vocalization (using the voice JANE). |
Vocalizer | createVocalizer(String language, String text, boolean autoPlay, String voice) | Creates a single-use object that performs text vocalization using the selected voice. |
String | getVersion() | Returns the library version. |
void | play() | Launches the speech synthesis process. |
void | setListener(VocalizerListener listener) | Specifies the object that will be passed messages about speech synthesis events. |
void | start() | Launches the speech synthesis process. |
Method descriptions
cancel
public void cancel ()
Interrupts the process of speech synthesis and vocalizing the synthesized speech.
createVocalizer
public static Vocalizer createVocalizer (String language, String text, boolean autoPlay)
Creates a single-use object that performs text vocalization (using the voice JANE).
language | The recognition language in BCP 47 format. In BCP 47 format, the language is indicated using the language code in ISO 639 format, followed by a dash (-), followed by the country code in ISO 3166-1 format. |
text | The text to convert to speech. |
autoPlay | Flag indicating whether synthesized text will be vocalized immediately by SpeechKit library resources. Possible values: |
language | The recognition language in BCP 47 format. In BCP 47 format, the language is indicated using the language code in ISO 639 format, followed by a dash (-), followed by the country code in ISO 3166-1 format. |
text | The text to convert to speech. |
autoPlay | Flag indicating whether synthesized text will be vocalized immediately by SpeechKit library resources. Possible values: |
Returns:
Instance of the Vocalizer class for vocalizing text with the specified parameters.
createVocalizer
public static Vocalizer createVocalizer (String language, String text, boolean autoPlay, String voice)
Creates a single-use object that performs text vocalization using the selected voice.
language | The recognition language in BCP 47 format. In BCP 47 format, the language is indicated using the language code in ISO 639 format, followed by a dash (-), followed by the country code in ISO 3166-1 format. |
text | The text to convert to speech. |
autoPlay | Flag indicating whether synthesized text will be vocalized immediately by SpeechKit library resources. Possible values: |
voice | Voice (see the Vocalizer.Voice class). |
language | The recognition language in BCP 47 format. In BCP 47 format, the language is indicated using the language code in ISO 639 format, followed by a dash (-), followed by the country code in ISO 3166-1 format. |
text | The text to convert to speech. |
autoPlay | Flag indicating whether synthesized text will be vocalized immediately by SpeechKit library resources. Possible values: |
voice | Voice (see the Vocalizer.Voice class). |
Returns:
Instance of the Vocalizer class for vocalizing text with the specified parameters.
getVersion
public static String getVersion ()
Returns the library version.
play
public void play ()
Launches the speech synthesis process.
This method should be called if autoPlay is set tofalse
.setListener
public void setListener (VocalizerListener listener)
Specifies the object that will be passed messages about speech synthesis events.
listener | Object that will receive callbacks. |
listener | Object that will receive callbacks. |
start
public void start ()
Launches the speech synthesis process.