public class Sound extends SimpleSound
_SoundIndexOffset, MAX_NEG, MAX_POS, SAMPLE_RATE
Constructor | Description |
---|---|
Sound(int numSamples) |
Constructor that takes the number of samples in
the sound
|
Sound(int numSamples,
int sampleRate) |
Constructor that takes the number of samples that this
sound will have and the sample rate
|
Sound(java.lang.String fileName) |
Constructor that takes a file name
|
Sound(Sound copySound) |
Constructor that takes a sound to copy
|
Modifier and Type | Method | Description |
---|---|---|
void |
copySoundInto(Sound dest,
int startIndex) |
Method to copy as much of this sound as will fit into
another sound.
|
Sound |
cropSound(int startIndex,
int numSamples) |
Mehtod to crop out a portion of this sound and return it
as a new sound
|
java.lang.String |
toString() |
Method to return the string representation of this sound
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
asArray, blockingPlay, blockingPlayAtRateDur, blockingPlayAtRateInRange, blockingPlayOld, convert, explore, getAudioFileFormat, getBuffer, getChannels, getFileName, getFrame, getLeftSample, getLength, getLengthInBytes, getLengthInFrames, getNumSamples, getPlaybacks, getRightSample, getSample, getSamples, getSampleValue, getSampleValueAt, getSamplingRate, getSoundExplorer, isStereo, loadFromFile, makeAIS, play, playAtRateDur, playAtRateInRange, playAtRateInRange, playNote, printError, printError, removePlayback, setAudioFileFormat, setBuffer, setBuffer, setFrame, setLeftSample, setRightSample, setSampleValue, setSampleValueAt, setSoundExplorer, stopPlaying, write, writeToFile
public Sound(java.lang.String fileName) throws SoundException
fileName
- the name of the file to read the sound fromSoundException
public Sound(int numSamples)
numSamples
- the number of samples desiredpublic Sound(int numSamples, int sampleRate)
numSamples
- the number of samples desiredsampleRate
- the number of samples per secondpublic Sound(Sound copySound)
copySound
- the Sound to copypublic java.lang.String toString()
toString
in class SimpleSound
public void copySoundInto(Sound dest, int startIndex) throws SoundException
dest
- the sound which gets copied intostartIndex
- the starting index for copyingSoundException
public Sound cropSound(int startIndex, int numSamples) throws SoundException
startIndex
- the index at which to start croppingnumSamples
- the number of samples to crop outSoundException