|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.iSpeech.SpeechSynthesis
public class SpeechSynthesis
Contains methods used to synthesize speech from text. You can get a reference
of this class by calling SpeechSynthesis.getInstance
. An API key is
required to use this class. You may obtain a free key from the following URL:
http://www.ispeech.org/
Nested Class Summary | |
---|---|
static interface |
SpeechSynthesis.SpeechSynthesisEvent
Used to notify SpeechSynthesis events. |
Method Summary | |
---|---|
void |
clearMetaAndOptionalCommands()
Clears any associated meta and optional parameters. |
void |
copyMeta(MetaData metadata)
Copies meta data information over to the speech synthesis object. |
static SpeechSynthesis |
getInstance(java.lang.String ApiKey,
boolean production)
Gets an instance of the iSpeech Speech Synthesis class. |
int |
information()
Gets the amount of credits remaining on this account. |
void |
setOptionalCommand(java.lang.String command,
java.lang.String parameter)
Specify additional parameters to send to the server. |
void |
setVoice(java.lang.String voice)
Sets the voice to the specified variable. |
boolean |
speak(java.lang.String Text,
int AudioPath,
int VolumeLevel,
SpeechSynthesis.SpeechSynthesisEvent speechSynthesisEvent)
Converts text to speech and begins playing it as soon as it is ready. |
boolean |
speak(java.lang.String Text,
SpeechSynthesis.SpeechSynthesisEvent speechSynthesisEvent)
Converts text to speech and begins playing it as soon as it is ready. |
void |
stop()
Stops the currently playing audio. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static SpeechSynthesis getInstance(java.lang.String ApiKey, boolean production) throws InvalidApiKeyException
ApiKey
- Your API key provided by iSpeech.production
- Set to true if you are deploying your application. Set to false if you are using the sandbox environment.
java.lang.IllegalArgumentException
- If the key is null or invalid.
InvalidApiKeyException
public boolean speak(java.lang.String Text, SpeechSynthesis.SpeechSynthesisEvent speechSynthesisEvent)
Text
- The text to convert into audio.speechSynthesisEvent
- A SpeechSynthesisEvent to receive messages and updates.public boolean speak(java.lang.String Text, int AudioPath, int VolumeLevel, SpeechSynthesis.SpeechSynthesisEvent speechSynthesisEvent)
Text
- The text to convert into audio.AudioPath
- The audio path. see AudioPathControl
. Set to -1 to not
change the current audio path.VolumeLevel
- Sets the volume level for the audio. Possible values are 0 -
100. Set to -1 to not change the current volume level.speechSynthesisEvent
- A SpeechSynthesisEvent to receive messages and updates.
java.io.IOException
- If a general error occurs or could not connect to the server
java.lang.IllegalArgumentException
javax.microedition.media.MediaException
- If the player object could not be created.
java.lang.InterruptedException
ApiException
- If the server returned an error message. The exception will
contain the server message. *public int information() throws java.io.IOException, ApiException
java.io.IOException
- If a network exception occurs
ApiException
- If the server returns an errorpublic void copyMeta(MetaData metadata) throws java.lang.Exception
metadata
-
java.lang.Exception
public void setOptionalCommand(java.lang.String command, java.lang.String parameter)
public void clearMetaAndOptionalCommands()
public void stop()
public void setVoice(java.lang.String voice)
voice
- Visit the iSpeech Developers center at http://www.ispeech.org or contact sales@ispeech.org to obtain a list of valid voices enabled for your account.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |