Class Sound

java.lang.Object
  extended by SimpleSound
      extended by Sound

public class Sound
extends SimpleSound

Class that represents a sound. This class is used by the students to extend the capabilities of SimpleSound. Copyright Georgia Institute of Technology 2004


Constructor Summary
Sound(int numSeconds)
          Constructor that takes the number of seconds that this sound will have
Sound(Sound copySound)
          Constructor that takes a sound to copy
Sound(java.lang.String fileName)
          Constructor that takes a file name
 
Method Summary
 void add(Sound s)
           
 void amplify(double increase)
           
 void blend(Sound sound1, Sound sound2)
           
static Sound blendedChord()
           
 void changeFrequency(double factor)
           
 DiffSound compress()
          Compresses the receiver as a DiffSound, encoded as an array of _differences_ between adjacent samples.
 Sound deepenTheVoice()
           
 void displaySamples(int count)
           
 void echo(int delay)
           
 int maximumDifference()
          Computes the maximum difference between any two samples.
 Sound reverse()
           
 java.lang.String toString()
          Method to return the string representation of this sound
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Sound

public Sound(java.lang.String fileName)
Constructor that takes a file name

Parameters:
fileName - the name of the file to read the sound from

Sound

public Sound(int numSeconds)
Constructor that takes the number of seconds that this sound will have

Parameters:
numSeconds - the number of seconds desired

Sound

public Sound(Sound copySound)
Constructor that takes a sound to copy

Method Detail

toString

public java.lang.String toString()
Method to return the string representation of this sound

Returns:
a string with information about this sound

compress

public DiffSound compress()
Compresses the receiver as a DiffSound, encoded as an array of _differences_ between adjacent samples.

Returns:
a DiffSound object

maximumDifference

public int maximumDifference()
Computes the maximum difference between any two samples.

Returns:
the **slot** that leads the maximum value change

add

public void add(Sound s)

blend

public void blend(Sound sound1,
                  Sound sound2)

blendedChord

public static Sound blendedChord()

echo

public void echo(int delay)

changeFrequency

public void changeFrequency(double factor)

reverse

public Sound reverse()

deepenTheVoice

public Sound deepenTheVoice()

displaySamples

public void displaySamples(int count)

amplify

public void amplify(double increase)