Orca Text-to-Speech
iOS API
API Reference for the Orca iOS SDK (Cocoapods).
Orca
Class for the Orca Text-to-Speech.
Orca can be initialized using the class constructor. Resources should be cleaned when you are
done using the delete()
method.
Orca.maxCharacterLimit
Maximum number of characters allowed in a single synthesis request.
Orca.version
The Orca library version string.
Orca.validCharacters
Set of characters supported by Orca.
Orca.sampleRate
Audio sample rate of generated audio.
Orca.init()
init
method for Orca Text-to-Speech Engine.
Parameters
access_key
String : AccessKey obtained from Picovoice Console.modelPath
String : Absolute path to file containing model parameters (.pv
).
Returns
Orca
: An instance of Orca Text-to-Speech Engine.
Throws
Parameters
accessKey
String : AccessKey obtained from Picovoice Console.modelURL
URL : URL to file containing model parameters (.pv
).
Returns
Orca
: An instance of Orca Text-to-Speech Engine.
Throws
Orca.delete()
Releases resources acquired by Orca.
Orca.synthesize()
Generates audio from text. The returned audio contains the speech representation of the text.
Parameters
text
String : Text to be converted to audio. The maximum number of characters per call to.synthesize()
isself.maxCharacterLimit
. Allowed characters can be retrieved by callingself.validCharacters
. Custom pronunciations can be embedded in the text via the syntax{word|pronunciation}
. The pronunciation is expressed in ARPAbet format, e.g.: "I {live|L IH V} in {Sevilla|S EH V IY Y AH}".speechRate
Double? : Speed of generated speech. Valid values are within[0.7, 1.3]
. Higher (lower) values produce faster (slower) speech. The default is1.0
.
Returns
[Int16]
: The generated audio, stored as a sequence of 16-bit linearly-encoded integers.
Throws
Orca.synthesizeToFile()
Generates audio from text and saves it to a WAV file. The file contains the speech representation of the text.
Parameters
text
String : Text to be converted to audio. The maximum number of characters per call to.synthesize()
isself.maxCharacterLimit
. Allowed characters can be retrieved by callingself.validCharacters
. Custom pronunciations can be embedded in the text via the syntax{word|pronunciation}
. The pronunciation is expressed in ARPAbet format, e.g.: "I {live|L IH V} in {Sevilla|S EH V IY Y AH}".outputPath
String : Absolute path to the output audio file. The output file is saved asWAV (.wav)
and consists of a single mono channel.speechRate
Double? : Speed of generated speech. Valid values are within[0.7, 1.3]
. Higher (lower) values produce faster (slower) speech. The default is1.0
.
Throws
Generates audio from text and saves it to a WAV file. The file contains the speech representation of the text.
Parameters
text
String : Text to be converted to audio. The maximum number of characters per call to.synthesize()
isself.maxCharacterLimit
. Allowed characters can be retrieved by callingself.validCharacters
. Custom pronunciations can be embedded in the text via the syntax{word|pronunciation}
. The pronunciation is expressed in ARPAbet format, e.g.: "I {live|L IH V} in {Sevilla|S EH V IY Y AH}".outputURL
URL : URL to the output audio file. The output file is saved asWAV (.wav)
and consists of a single mono channel.speechRate
Double? : Speed of generated speech. Valid values are within[0.7, 1.3]
. Higher (lower) values produce faster (slower) speech. The default is1.0
.
Throws
OrcaError
Error thrown if an error occurs within Orca
Text-to-Speech engine.
Exceptions