| Package | com.acapela.vaas |
| Class | public class BasicVaas |
| Inheritance | BasicVaas flash.events.EventDispatcher |
It enables you to create a message using:
You will have access to:
Using this class is the simpliest way to use voice as a service. However, it does not provide access to advanced functions of the service.
Anyway, if it is offering enough for you, you can forget about the rest of the API.
Note about authentication :
Our service is constantly evolving and we do our best to maintain backward compliance.
That is why there is different ways to proceed with authentication:
accountLogin, applicationLogin and password properties.
serviceURL property.
| Property | Defined by | ||
|---|---|---|---|
| accountLogin : String
The service URL you received from Acapela.
| BasicVaas | ||
| applicationLogin : String
The application login (optionnal, could be received from Acapela or created on your backoffice)
| BasicVaas | ||
| lastError : String [read-only]
The description of the error that just happened.
You should access it only from the error | BasicVaas | ||
| password : String
The application/main account password to use (received from Acapela or created on your backoffice)
| BasicVaas | ||
| requestedId : String [read-only]
The ID (identifier) of the message that was just generated.
| BasicVaas | ||
| requestedSound : Sound [read-only]
The Sound object corresponding to the message that was just generated.
| BasicVaas | ||
| serviceURL : String
The service URL you may have receive from Acapela.
| BasicVaas | ||
| Method | Defined by | ||
|---|---|---|---|
|
use it to create a new BasicVaas object instance.
| BasicVaas | ||
|
generateMessage(voice:String, text:String):void
This function will post a message generation request to the service.
| BasicVaas | ||
|
pause():void
Pauses the sound that is playing.
| BasicVaas | ||
|
play(voice:String, message:String):void
Play the corresponding sound of the requested message.
| BasicVaas | ||
|
replay(snd_id:String = null):void
Play the corresponding sound of the message identified by its id.
| BasicVaas | ||
|
resume():void
Resumes the sound that is paused.
| BasicVaas | ||
|
retrieveMessage(msgId:String):void
This function will post a request to the service in order to retrieve a previously generated message.
| BasicVaas | ||
|
stop():void
Stops the sound that is playing.
| BasicVaas | ||
| Constant | Defined by | ||
|---|---|---|---|
| ERROR : String = "error" [static]
Type of the event dispatched when an error occured while calling
generateMessage or retrieveMessage. | BasicVaas | ||
| MESSAGE_AVAILABLE : String = "messageAvailable" [static]
Type of the event dispatched as a result of a successfull call to
generateMessage or retrieveMessage. | BasicVaas | ||
| accountLogin | property |
accountLogin:String [read-write]The service URL you received from Acapela. Make sure you include the tailing '/' (slash) if there is one.
Implementation public function get accountLogin():String
public function set accountLogin(value:String):void
See also
| applicationLogin | property |
applicationLogin:String [read-write]The application login (optionnal, could be received from Acapela or created on your backoffice)
Implementation public function get applicationLogin():String
public function set applicationLogin(value:String):void
See also
| lastError | property |
lastError:String [read-only]
The description of the error that just happened.
You should access it only from the error event handler.
public function get lastError():String
| password | property |
password:String [read-write]The application/main account password to use (received from Acapela or created on your backoffice)
Implementation public function get password():String
public function set password(value:String):void
See also
| requestedId | property |
requestedId:String [read-only]
The ID (identifier) of the message that was just generated.
You should access it only from the messageAvailable event handler.
public function get requestedId():String
| requestedSound | property |
requestedSound:Sound [read-only]
The Sound object corresponding to the message that was just generated.
You should access it only from the messageAvailable event handler.
public function get requestedSound():Sound
| serviceURL | property |
serviceURL:String [read-write]The service URL you may have receive from Acapela. If not, don't set this property. Make sure you include the tailing '/' (slash) if there is one.
Implementation public function get serviceURL():String
public function set serviceURL(value:String):void
See also
| BasicVaas | () | constructor |
public function BasicVaas()use it to create a new BasicVaas object instance.
| generateMessage | () | method |
public function generateMessage(voice:String, text:String):voidThis function will post a message generation request to the service.
The result will be a dispatched event when the request will be treated.
This event could be:
messageAvailable event when message is generated and the corresponding sound downloaded,error event when the operation failed.voice:String — identifier of the voice to use for the sound generation. e.g. : "heather22k"
|
|
text:String — text to synthesize. e.g. : "hello, my name is Heather."
|
| pause | () | method |
public function pause():voidPauses the sound that is playing.
| play | () | method |
public function play(voice:String, message:String):voidPlay the corresponding sound of the requested message.
The event could be a dispatched when the request will be treated:
messageAvailable event when message is generated and the corresponding sound downloaded,error event when the operation failed.voice:String — identifier of the voice to use for the sound generation. e.g. : "heather22k"
|
|
message:String — text to synthesize. e.g. : "hello, my name is Heather."
|
| replay | () | method |
public function replay(snd_id:String = null):voidPlay the corresponding sound of the message identified by its id. If its id is null, the player will try to replay the current message.
Parameterssnd_id:String (default = null) — identifier of the message to use. The id received with MessageObtained event."
|
| resume | () | method |
public function resume():voidResumes the sound that is paused.
| retrieveMessage | () | method |
public function retrieveMessage(msgId:String):voidThis function will post a request to the service in order to retrieve a previously generated message.
The result will be a dispatched event when the request will be treated.
This event could be:
messageAvailable event when message is generated and the corresponding sound downloaded,error event when the operation failed.msgId:String — ID (identifier) of the message previously generated
|
See also
| stop | () | method |
public function stop():voidStops the sound that is playing. The sound will be restarted at the beginning.
| ERROR | constant |
public static const ERROR:String = "error"
Type of the event dispatched when an error occured while calling generateMessage or retrieveMessage.
The target of this event is the BasicVaas instance that generated it.
You can access to the error description using the lastError property of this instance.
See also
| MESSAGE_AVAILABLE | constant |
public static const MESSAGE_AVAILABLE:String = "messageAvailable"
Type of the event dispatched as a result of a successfull call to generateMessage or retrieveMessage.
It occurs when the ID of the requested message was received and the corresponding Sound objet was loaded.
The target of this event is the BasicVaas instance that generated it.
You can access to the id and the Sound object associated to the message using the requestedId and requestedSound properties of this instance.
See also