one.radio
Class AudioSink

java.lang.Object
  |
  +--one.world.core.Component
        |
        +--one.radio.AudioSink
All Implemented Interfaces:
Serializable

public final class AudioSink
extends Component

Plays audio in the form of AudioMessages to the system speakers. Audio streams are demultiplexed based on AudioMessage.streamId.

Imported and Exported Event Handlers

Exported event handlers:

audio
Handles AudioMessages by playing the audio data to the system speakers.
control
Handles AudioSink.ControlEvents.

Implementation note: AudioSink does not perform general message reordering, but it will correct inversions (a pair of messages received out of order) and drop late messages.

Version:
$Revision: 1.17 $
See Also:
AudioSource, Serialized Form

Inner Class Summary
static class AudioSink.ControlEvent
          The audio sink control event.
 
Inner classes inherited from class one.world.core.Component
Component.HandlerReference, Component.Importer
 
Field Summary
static double BUFFER_DURATION
          The default buffer duration, in fractions of a second.
static int DEFAULT_VOLUME
          The default volume is 50, on a scale of 0-100.
 
Constructor Summary
AudioSink(Environment env)
          Create a new instance of AudioSink.
 
Method Summary
protected  void finalize()
          Finalize this audio sink.
 ComponentDescriptor getDescriptor()
          Get the component descriptor.
protected  void writeObject(ObjectOutputStream out)
          Serialize this audio sink.
 
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
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_VOLUME

public static final int DEFAULT_VOLUME
The default volume is 50, on a scale of 0-100.

BUFFER_DURATION

public static final double BUFFER_DURATION
The default buffer duration, in fractions of a second. This constant controls how much data is buffered before playback starts. The smaller it is, the less delay; the larger it is, the smoother the playback.
Constructor Detail

AudioSink

public AudioSink(Environment env)
Create a new instance of AudioSink.
Parameters:
env - The environment for the new instance.
Method Detail

finalize

protected void finalize()
Finalize this audio sink.
Overrides:
finalize in class Object

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 sink.


(C) Copyright 2001 UW CSE