games.stendhal.client.soundreview
Class AudioClip

java.lang.Object
  extended by games.stendhal.client.soundreview.AudioClip

public class AudioClip
extends java.lang.Object

This is an audio clip.

Author:
mtotz

Constructor Summary
AudioClip(javax.sound.sampled.Mixer mixer, byte[] audioData, int volume)
          creates the audio clip.
 
Method Summary
 int getLength()
           
 int getVolume()
           
 javax.sound.sampled.Clip openLine()
          opens the given line with the encapsulated audio data.
 void stop()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AudioClip

public AudioClip(javax.sound.sampled.Mixer mixer,
                 byte[] audioData,
                 int volume)
          throws javax.sound.sampled.UnsupportedAudioFileException,
                 java.io.IOException
creates the audio clip.

Parameters:
mixer - the Mixer instance to be used
audioData - the audio data
volume - the loudness 0..100
Throws:
java.io.IOException
javax.sound.sampled.UnsupportedAudioFileException
Method Detail

getLength

public int getLength()
Returns:
Returns the length.

getVolume

public int getVolume()
Returns:
Returns the volume.

openLine

public javax.sound.sampled.Clip openLine()
                                  throws javax.sound.sampled.UnsupportedAudioFileException,
                                         java.io.IOException,
                                         javax.sound.sampled.LineUnavailableException
opens the given line with the encapsulated audio data.

Returns:
the supported open line or null
Throws:
java.io.IOException
javax.sound.sampled.UnsupportedAudioFileException
javax.sound.sampled.LineUnavailableException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

stop

public void stop()