speech
Class SpeechOutAgent
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--metaglue.AgentAgent
|
+--agentland.util.GoodAgent
|
+--agentland.resource.ManagedAgent
|
+--speech.SpeechOutAgent
- All Implemented Interfaces:
- Agent, Good, Managed, MetagluePrimitives, Remote, Serializable, SpeechOut, Spy, TalkNSing
- public class SpeechOutAgent
- extends ManagedAgent
- implements SpeechOut, TalkNSing
This is the thing that talks to Laureate, or something if there
is no Laureate to talk to.
Cheesy name but all variants of Synthesizer are already reserved by
JSAPI.
- See Also:
ManagedAgent
,
SpeechOut
,
TalkNSing
, Serialized Form
Constructor Summary |
SpeechOutAgent()
Creates a new SpeechOutAgent instance. |
Method Summary |
boolean |
busy()
Returns whether speech out is busy talking. |
void |
playWav(String filename)
|
void |
playWavSync(String filename)
|
void |
reconnect()
|
void |
say(Collection c)
Randomly speak one of the objects in the given collection. |
void |
say(Speakable sObject)
Speak this object's toSpeech using speech synthesis. |
void |
say(String sText)
Speak the given String using speech synthesis. |
void |
saySafe(String sText)
Speaks text in a "safe" manner, such that it can be interrupted. |
void |
saySafe(String sText,
String sDelim)
Speaks text in a "safe" manner, such that it can be interrupted. |
void |
saySync(String sText)
Synchronously speak the given String using speech synthesis. |
void |
startup()
|
boolean |
status()
|
void |
stopTalking()
Stops saySafe's speech out. |
void |
stopTalking(boolean bAnnounce)
Stops saySafe's speech out, and if bAnnounce is true, then say's
"shutting up" |
Methods inherited from class agentland.resource.ManagedAgent |
connect, getAlert, getNeed, isAvailable, isAvailable, reliesOn, reliesOn, replace, replace, request, request, request, requestAgent, requestAgent, resources, resourcesByAgentID, setNeed, tiedTo, yank, yank, yank |
Methods inherited from class agentland.util.GoodAgent |
addSpy, addSpy, alert, alertString, beep, error, getHistory, getHistoryElement, getPersistentMap, log, notify, removeSpy, removeSpy, resetHistory, safeRely, safeRely, safeRely, setNiceLogName, tell |
Methods inherited from class metaglue.AgentAgent |
addMonitor, alive, buildEHAFor, defrost, defrostAll, defrostBoolean, defrostInt, defrostString, fixAttribute, fixAttribute, freeze, freeze, freeze, freezeAll, freezeVar, getAgentID, getAttribute, getCatalog, getCatalogID, getDesignation, getFrozenVariables, getLogLevel, getMetaglueAgent, getMetaglueAgentID, getOccupation, getOldLogs, getProperties, getProxyHandlerClass, getSociety, installAPH, log, log, lookupClass, reliesOn, reliesOnSynch, removeAPHFromCatalog, removeFrozen, setFreezeName, setLogLevel, setLogName, shutdown, startAgent, startAgentOn, startAgentOn, status, tiedTo, tiedTo, tiedTo, tiedTo, tieToDesignation, toString, whereAreYou |
Methods inherited from interface agentland.util.Spy |
tell |
SpeechOutAgent
public SpeechOutAgent()
throws RemoteException
- Creates a new
SpeechOutAgent
instance.
- Throws:
RemoteException
- if an error occurs
startup
public void startup()
throws RemoteException
- Specified by:
startup
in interface Agent
- Overrides:
startup
in class AgentAgent
reconnect
public void reconnect()
- Specified by:
reconnect
in interface SpeechOut
saySync
public void saySync(String sText)
- Synchronously speak the given String using speech synthesis.
- Specified by:
saySync
in interface TalkNSing
- Parameters:
sText
- a String
value
say
public void say(String sText)
- Speak the given String using speech synthesis.
- Specified by:
say
in interface TalkNSing
- Parameters:
sText
- a String
value
say
public void say(Speakable sObject)
- Speak this object's toSpeech using speech synthesis.
- Specified by:
say
in interface TalkNSing
- Parameters:
sObject
- a Speakable
value
say
public void say(Collection c)
- Randomly speak one of the objects in the given collection.
If the object is Speakable, then the toSpeech method is used,
otherwise the toString method is used.
- Specified by:
say
in interface TalkNSing
- Parameters:
c
- a Collection
value
stopTalking
public void stopTalking()
- Stops saySafe's speech out.
- Specified by:
stopTalking
in interface TalkNSing
- Following copied from interface:
speech.TalkNSing
- Throws:
RemoteException
- if an error occurs
stopTalking
public void stopTalking(boolean bAnnounce)
- Stops saySafe's speech out, and if bAnnounce is true, then say's
"shutting up"
- Specified by:
stopTalking
in interface TalkNSing
- Parameters:
bAnnounce
- a boolean
value
saySafe
public void saySafe(String sText)
- Speaks text in a "safe" manner, such that it can be interrupted.
saySafe tokenizes the text into sentence-size chunks.
- Specified by:
saySafe
in interface TalkNSing
- Parameters:
sText
- a String
value
saySafe
public void saySafe(String sText,
String sDelim)
- Speaks text in a "safe" manner, such that it can be interrupted.
saySafe tokenizes the text into chunks based on a delimeter.
- Specified by:
saySafe
in interface TalkNSing
- Parameters:
sText
- a String
valuesDelim
- a String
value
busy
public boolean busy()
- Returns whether speech out is busy talking.
- Specified by:
busy
in interface TalkNSing
- Returns:
- a
boolean
value
playWavSync
public void playWavSync(String filename)
- Specified by:
playWavSync
in interface TalkNSing
playWav
public void playWav(String filename)
- Specified by:
playWav
in interface TalkNSing
status
public boolean status()
- Specified by:
status
in interface SpeechOut