public class Sound extends SimpleSound
_SoundIndexOffset, MAX_NEG, MAX_POS, SAMPLE_RATE
Constructor and 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(Sound copySound)
Constructor that takes a sound to copy
|
Sound(java.lang.String fileName)
Constructor that takes a file name
|
Modifier and Type | Method and 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
|
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