Package ai.picovoice.orca
Class Orca
java.lang.Object
ai.picovoice.orca.Orca
Android binding for Orca Text-to-Speech engine. Orca converts text to spoken audio
without network latency.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for creating instance of Orca. -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()Releases resources acquired by Orca.intGetter for the maximum number of characters that can be synthesized at once.intGetter for the audio sampling rate of the audio produced by Orca.String[]Getter for the set of characters that are accepted as input to Orca synthesize functions.Getter for version.static voidshort[]synthesize(String text, OrcaSynthesizeParams params) Generates audio from text.voidsynthesizeToFile(String text, String outputPath, OrcaSynthesizeParams params) Generates audio from text and saves it to a file.
-
Method Details
-
setSdk
-
delete
public void delete()Releases resources acquired by Orca. -
synthesize
Generates audio from text. The returned audio contains the speech representation of the text.- Parameters:
text- Text to be converted to audio. The maximum length can be attained by calling `getMaxCharacterLimit()`. Allowed characters can be retrieved by calling `getValidCharacters()`. Custom pronunciations can be embedded in the text via the syntax `{word|pronunciation}`. The pronunciation is expressed in ARPAbet format, e.g.: `I {liv|L IH V} in {Sevilla|S EH V IY Y AH}`.params- Global parameters for synthesized text. See 'OrcaSynthesizeParams' for details.- Returns:
- The output audio.
- Throws:
OrcaException- if there is an error while synthesizing audio.
-
synthesizeToFile
public void synthesizeToFile(String text, String outputPath, OrcaSynthesizeParams params) throws OrcaException Generates audio from text and saves it to a file. The file contains the speech representation of the text.- Parameters:
text- Text to be converted to audio. The maximum length can be attained by calling `getMaxCharacterLimit()`. Allowed characters can be retrieved by calling `getValidCharacters()`. Custom pronunciations can be embedded in the text via the syntax `{word|pronunciation}`. The pronunciation is expressed in ARPAbet format, e.g.: `I {liv|L IH V} in {Sevilla|S EH V IY Y AH}`.outputPath- Absolute path to the output audio file. The output file is saved as `WAV (.wav)` and consists of a single mono channel.params- Global parameters for synthesized text. See 'OrcaSynthesizeParams' for details.- Throws:
OrcaException- if there is an error while synthesizing audio to file.
-
getVersion
Getter for version.- Returns:
- Version.
-
getMaxCharacterLimit
public int getMaxCharacterLimit()Getter for the maximum number of characters that can be synthesized at once.- Returns:
- The maximum number of characters that can be synthesized at once.
-
getSampleRate
Getter for the audio sampling rate of the audio produced by Orca.- Returns:
- Audio sampling rate of the audio produced by Orca.
- Throws:
OrcaException
-
getValidCharacters
Getter for the set of characters that are accepted as input to Orca synthesize functions.- Returns:
- Array of characters that are accepted as input to Orca synthesize functions.
- Throws:
OrcaException
-