WIDAR Classes

edu.nrao.widar.gui.widget
Class Sound

java.lang.Object
  extended by edu.nrao.widar.gui.widget.Sound
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class Sound
extends java.lang.Object
implements java.awt.event.ActionListener

A Sound player. Plays a specified sound URL or file. This first cut is very simple and can only play non-compressed files like .wav but not mp3. The constructor creates an audio clip that can be played or looped. It is for short (under 1MB) files like that would be used for an alarm sound. The static 'playAudioFile' method can be used to play files of any length (but still uncompressed files only).

Since:
1.5
Author:
KJRyan
Created:
2009.02.02
 

Nested Class Summary
static class Sound.AudioPlayerThread
           
 
Constructor Summary
Sound(java.lang.String filename)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void loop()
           
 void loop(int repeatPeriodMillis)
           
static void main(java.lang.String[] args)
           
 void play()
           
static void playAudioFile(java.lang.String filename)
           
static void quit()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sound

public Sound(java.lang.String filename)
      throws java.io.IOException
Throws:
java.io.IOException
Method Detail

play

public void play()

loop

public void loop()

loop

public void loop(int repeatPeriodMillis)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

stop

public void stop()

quit

public static void quit()

playAudioFile

public static void playAudioFile(java.lang.String filename)
                          throws java.io.IOException
Throws:
java.io.IOException

main

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

NRAO/DRAO

National Radio Astronomy Observatory