Packageispeech
Classpublic class SpeechSynthesis
InheritanceSpeechSynthesis Inheritance flash.media.Sound

Contains methods used to synthesize speech from text. You can get a reference of this class by calling

See also

An API key is required to use this class. You may obtain a free key from the following URL: {http://www.ispeech.org/}


Public Properties
 PropertyDefined By
  credits : Number = -1
Stores credits of corresponding apikey.
SpeechSynthesis
Public Methods
 MethodDefined By
  
SpeechSynthesis(ApiKey:String, production:Boolean = false)
SpeechSynthesis
  
Clears all optional parameters that were set.
SpeechSynthesis
  
getInstance(api:String, production:Boolean):SpeechSynthesis
[static] Gets an instance of the iSpeech SpeechSynthesis class.
SpeechSynthesis
  
Finds amount of credits for your apikey.
SpeechSynthesis
  
setOptionalCommand(command:String, parameter:String):void
Specify additional parameters to send to the server.
SpeechSynthesis
  
setVoice(voice:String):void
Sets the voice, default is usfemaleenglish1
SpeechSynthesis
  
speak(text:String):void
Converts text into speech.
SpeechSynthesis
Property Detail
creditsproperty
public var credits:Number = -1

Stores credits of corresponding apikey. You must call information() to recieve data

Constructor Detail
SpeechSynthesis()Constructor
public function SpeechSynthesis(ApiKey:String, production:Boolean = false)



Parameters
ApiKey:String
 
production:Boolean (default = false)
Method Detail
clearMetaAndOptionalCommands()method
public function clearMetaAndOptionalCommands():void

Clears all optional parameters that were set.

getInstance()method 
public static function getInstance(api:String, production:Boolean):SpeechSynthesis

Gets an instance of the iSpeech SpeechSynthesis class. The ApiKey parameter is only required on initial call to this method.

Parameters

api:String — Your API key provided by iSpeech.
 
production:Boolean — Set to true if you are deploying your application. Set to false if you are using the sandbox environment.

Returns
SpeechSynthesis
information()method 
public function information():void

Finds amount of credits for your apikey. since flash is event-driven this value cannot be returned in this function. Instead, it is stored in the credits property of the class. A datagetevent is dispatched, the value of credits is stored in it's data property.

setOptionalCommand()method 
public function setOptionalCommand(command:String, parameter:String):void

Specify additional parameters to send to the server.

Parameters

command:String — A valid command
 
parameter:String — A valid setting for the command

setVoice()method 
public function setVoice(voice:String):void

Sets the voice, default is usfemaleenglish1

Parameters

voice:String

speak()method 
public function speak(text:String):void

Converts text into speech. Audio begins to stream through this object.

Parameters

text:String — The text you wish to have converted into audio.