sub_arctic.new_lib
Class audio_renderer

java.lang.Object
  |
  +--sub_arctic.new_lib.audio_renderer

public class audio_renderer
extends java.lang.Object
implements java.lang.Cloneable

This class describes an audio segment that is to be "rendered" (aka played). Currently, this just wraps a java.applet.AudioClip object for an audio icon and a piece of text that should be rendered with it. This is primarily a placeholder for something more reasonable later (since applet audio clips are too limited to use effectively). As a result, this class (and its API) are highly likely to change.


Field Summary
protected  java.applet.AudioClip _audio_icon
          The audio icon portion of this sound.
protected  java.lang.String _text_to_speak
          The text to be spoken with this sound
 
Constructor Summary
audio_renderer()
          Constructor for an empty audio rendition.
audio_renderer(java.applet.AudioClip aud_icon)
          Constructor with just an audio icon.
audio_renderer(java.applet.AudioClip aud_icon, java.lang.String txt)
          Full constructor.
audio_renderer(java.lang.String txt)
          Constructor with just text to be spoken.
 
Method Summary
 java.applet.AudioClip audio_icon()
          The audio icon portion of this sound.
 java.lang.Object clone()
          Generic clone operation
 audio_renderer copy()
          Clone operation with a correct type
 void play()
          Play this piece of audio.
 void set_audio_icon(java.applet.AudioClip new_clip)
          Set the audio icon portion of this sound.
 void set_text_to_speak(java.lang.String new_text)
          Set the text to be spoken with this sound.
 void stop_playing()
          Stop playing this audio.
 java.lang.String text_to_speak()
          The text to be spoken with this sound
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_audio_icon

protected java.applet.AudioClip _audio_icon
The audio icon portion of this sound.

_text_to_speak

protected java.lang.String _text_to_speak
The text to be spoken with this sound
Constructor Detail

audio_renderer

public audio_renderer(java.applet.AudioClip aud_icon,
                      java.lang.String txt)
Full constructor.
Parameters:
AudioClip - aud_icon an audio icon to play
String - txt a text string providing additional content to be spoken.

audio_renderer

public audio_renderer(java.applet.AudioClip aud_icon)
Constructor with just an audio icon.
Parameters:
AudioClip - aud_icon an audio icon to play

audio_renderer

public audio_renderer(java.lang.String txt)
Constructor with just text to be spoken.
Parameters:
String - txt a text string providing additional content to be spoken.

audio_renderer

public audio_renderer()
Constructor for an empty audio rendition.
Method Detail

clone

public java.lang.Object clone()
Generic clone operation
Returns:
Object a copy of this object.
Overrides:
clone in class java.lang.Object

copy

public audio_renderer copy()
Clone operation with a correct type
Returns:
audio_renderer a copy of this object

audio_icon

public java.applet.AudioClip audio_icon()
The audio icon portion of this sound.
Returns:
AudioClip a clip for the audio icon

set_audio_icon

public void set_audio_icon(java.applet.AudioClip new_clip)
Set the audio icon portion of this sound.
Parameters:
AudioClip - new_clip a new clip for the audio icon

text_to_speak

public java.lang.String text_to_speak()
The text to be spoken with this sound
Returns:
String a text to be spoken with this sound

set_text_to_speak

public void set_text_to_speak(java.lang.String new_text)
Set the text to be spoken with this sound.
Parameters:
String - new_text new text value

play

public void play()
Play this piece of audio. Presently, this plays the audio icon and prints the text on one line of standard output with the tag "#SPEAK:" at the beginning (anticpating an external speech synthesizer). Due to the severe limitations of applet audio, there is no indication of completion (this returns immediately once the sound starts playing) and additional sound played after this are interleaved with it in an awkward fashion.

stop_playing

public void stop_playing()
Stop playing this audio. This currently calls stop() on the clip for the audio icon and does nothing with respect to the spoken text.