speech.sound
Class SoundManagerAgent

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--metaglue.AgentAgent
                          |
                          +--speech.sound.SoundManagerAgent

public class SoundManagerAgent
extends AgentAgent
implements SoundManager

Agent to play sound files, such as AIFF, AU, WAV (PCM only), and MIDI. This agent makes use of AudioPlayer. To play a sound, just call play(URL). If you are going to play a sound repeatedly, calling play will first load(URL) it into a cache. You can manually call load as well.

See Also:
Serialized Form

Inner classes inherited from class metaglue.AgentAgent
AgentAgent.Attribute
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Constructor Summary
SoundManagerAgent()
          Creates a new SoundManagerAgent instance.
 
Method Summary
 void load(URL mediaURL)
          Manually loads a sound file into the cache.
 void loadFile(URL mediaURL)
          Deprecated. Replaced by load(URL)
 void play(URL mediaURL)
          Plays a sound file.
 void playSync(URL mediaURL)
          Synchronously plays a sound file.
 void unload(URL mediaURL)
          Manually unloads a sound file from the cache.
 void unloadFile(URL mediaURL)
          Deprecated. Replaced by unload(URL)
 
Methods inherited from class metaglue.AgentAgent
addMonitor, alive, defrost, defrostAll, defrostBoolean, defrostInt, defrostString, fixAttribute, fixAttribute, freeze, freeze, freeze, freezeAll, freezeVar, getAgentID, getAttribute, getCatalog, getCatalogID, getDesignation, getFrozenVariables, getLogLevel, getMetaglueAgent, getMetaglueAgentID, getOccupation, getProperties, getSociety, log, log, log, obtainMetaglueAgent, obtainMetaglueAgent, obtainMetaglueAgentByName, reliesOn, reliesOn, reliesOn, reliesOnSynch, removeFrozen, replaceExceptionHandler, setFreezeName, setLogLevel, setLogName, shutdown, startAgent, startAgentOn, startAgentOn, startup, status, tiedTo, tiedTo, tiedTo, tiedTo, tieToDesignation, whereAreYou
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SoundManagerAgent

public SoundManagerAgent()
                  throws RemoteException
Creates a new SoundManagerAgent instance. This agent is tied to the value of the host attribute.
Throws:
RemoteException - if an error occurs
Method Detail

load

public void load(URL mediaURL)
          throws RemoteException
Manually loads a sound file into the cache.
Specified by:
load in interface SoundManager
Parameters:
mediaURL - an URL value
Throws:
RemoteException - if an error occurs

loadFile

public void loadFile(URL mediaURL)
              throws RemoteException
Deprecated. Replaced by load(URL)

Specified by:
loadFile in interface SoundManager
Parameters:
mediaURL - an URL value
Throws:
RemoteException - if an error occurs

play

public void play(URL mediaURL)
          throws RemoteException
Plays a sound file. This plays a cached sound if one exists.
Specified by:
play in interface SoundManager
Parameters:
mediaURL - an URL value
Throws:
RemoteException - if an error occurs

playSync

public void playSync(URL mediaURL)
              throws RemoteException
Synchronously plays a sound file. This plays a cached sound if one exists.
Specified by:
playSync in interface SoundManager
Parameters:
mediaURL - an URL value
Throws:
RemoteException - if an error occurs

unload

public void unload(URL mediaURL)
            throws RemoteException
Manually unloads a sound file from the cache.
Specified by:
unload in interface SoundManager
Parameters:
mediaURL - an URL value
Throws:
RemoteException - if an error occurs

unloadFile

public void unloadFile(URL mediaURL)
                throws RemoteException
Deprecated. Replaced by unload(URL)

Specified by:
unloadFile in interface SoundManager
Parameters:
mediaURL - an URL value
Throws:
RemoteException - if an error occurs