one.radio
Class AudioSource
java.lang.Object
|
+--one.world.core.Component
|
+--one.radio.AudioSource
- All Implemented Interfaces:
- Serializable
- public final class AudioSource
- extends Component
Sends AudioMessages to a one.radio channel. Currently, the
audio is captured from a microphone.
Imported and Exported Event Handlers
Exported event handlers:
- control
- Handles
AudioSource.ControlEvents, which are used to start, stop,
pause, and unpause the audio source. Note that the response to
a start event may be a SecurityException, IllegalArgumentException, LineUnavailableException,
UnknownResourceException, or LeaseException
rather than a started event.
Imported event handlers:
- audio
- An event handler that accepts
AudioMessages and
TextMessages. The audio handler is also informed of
NoSuchTupleExceptions, LeaseExceptions, and
ResourceRevokedExceptions, all of which also result in
streaming being stopped.
- request
- The environment request handler.
- Version:
- $Revision: 1.27 $
- See Also:
AudioSink, Serialized Form
|
Field Summary |
static int |
BUFFER_LENGTH
The number of bytes to read at a time. |
| Methods inherited from class one.world.core.Component |
declareExported, declareImported, equals, eventHandlers, getDescriptor, getEnvironment, getLinkedHandlers, getLinkedNumber, getTimer, hasEventHandler, hashCode, isFullyLinked, isLinked, isSealed, link, link, run, seal, unbox, undeclare, unlink, wrap |
BUFFER_LENGTH
public static final int BUFFER_LENGTH
- The number of bytes to read at a time.
AudioSource
public AudioSource(Environment env,
String sender,
String channel)
- Create a new instance of
AudioSource that streams
captured audio.
- Parameters:
env - The environment for the new instance.sender - The sender name to use in the generated messages.channel - The channel name to use in the generated messages.
AudioSource
public AudioSource(Environment env,
String sender,
String channel,
String path)
- Create a new instance of
AudioSource that streams audio
from tuples in an environment.
- Parameters:
env - The environment for the new instance.sender - The sender name to use in the generated messages.channel - The channel name to use in the generated messages.path - The relative path of the environment to play
sound tuples from.
getDescriptor
public ComponentDescriptor getDescriptor()
- Get the component descriptor.
- Overrides:
getDescriptor in class Component
- Following copied from class:
one.world.core.Component
- Returns:
- The component descriptor for this component.
writeObject
protected void writeObject(ObjectOutputStream out)
throws IOException
- Serialize this audio source.
(C) Copyright 2001 UW CSE