Class Song

java.lang.Object
  extended by Song

public class Song
extends java.lang.Object


Constructor Summary
Song(int duration)
          Constructs a silent Song to which content can be added.
 
Method Summary
 void add(double[] ds)
          Adds more content to the Song, after previous content.
 void play(SoundDevice device)
          Plays the Song on a given device.
 void save(javax.sound.sampled.AudioFormat format, java.io.File file)
          Saves the Song on a file in WAV format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Song

public Song(int duration)
Constructs a silent Song to which content can be added.

Parameters:
duration - maximum length in seconds.
Method Detail

play

public void play(SoundDevice device)
Plays the Song on a given device.

Parameters:
device - the SoundDevice on which to play the song.

save

public void save(javax.sound.sampled.AudioFormat format,
                 java.io.File file)
Saves the Song on a file in WAV format.

Parameters:
format - The AudioFormat used (can be retrieved from the SoundDevice).
file - The File to be written.

add

public void add(double[] ds)
Adds more content to the Song, after previous content.

Parameters:
ds - the content to be added.