local.media
Class AudioClipPlayer

java.lang.Object
  |
  +--local.media.AudioClipPlayer
All Implemented Interfaces:
java.util.EventListener, javax.sound.sampled.LineListener

public class AudioClipPlayer
extends java.lang.Object
implements javax.sound.sampled.LineListener

Plays an audio file.


Constructor Summary
AudioClipPlayer(javax.sound.sampled.AudioInputStream audio_inputstream, AudioClipPlayerListener listener)
          Creates the SoundPlayer
AudioClipPlayer(java.io.File file, AudioClipPlayerListener listener)
          Creates the SoundPlayer
AudioClipPlayer(java.io.InputStream inputstream, AudioClipPlayerListener listener)
          Creates the SoundPlayer
AudioClipPlayer(java.lang.String filename, AudioClipPlayerListener listener)
          Creates the SoundPlayer
 
Method Summary
 void goTo(long millisec)
          Goes to a time position
 void loop()
          Loops the sound until stopped
 void loop(int n)
          Loops the sound n times. if n=0, it loops until stopped
static void main(java.lang.String[] args)
          The main method.
 void play()
          Plays the sound
 void replay()
          Plays the sound from begining (restart)
 void rewind()
          Rewinds the sound
 void stop()
          Stops and rewinds the sound
 void update(javax.sound.sampled.LineEvent event)
          Called by the sound line
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AudioClipPlayer

public AudioClipPlayer(java.lang.String filename,
                       AudioClipPlayerListener listener)
Creates the SoundPlayer

AudioClipPlayer

public AudioClipPlayer(java.io.File file,
                       AudioClipPlayerListener listener)
Creates the SoundPlayer

AudioClipPlayer

public AudioClipPlayer(java.io.InputStream inputstream,
                       AudioClipPlayerListener listener)
Creates the SoundPlayer

AudioClipPlayer

public AudioClipPlayer(javax.sound.sampled.AudioInputStream audio_inputstream,
                       AudioClipPlayerListener listener)
Creates the SoundPlayer
Method Detail

loop

public void loop()
Loops the sound until stopped

loop

public void loop(int n)
Loops the sound n times. if n=0, it loops until stopped

play

public void play()
Plays the sound

stop

public void stop()
Stops and rewinds the sound

rewind

public void rewind()
Rewinds the sound

goTo

public void goTo(long millisec)
Goes to a time position

replay

public void replay()
Plays the sound from begining (restart)

update

public void update(javax.sound.sampled.LineEvent event)
Called by the sound line
Specified by:
update in interface javax.sound.sampled.LineListener

main

public static void main(java.lang.String[] args)
The main method.