blockingPlay
|
blockingPlay(sound):
sound: the sound that you want to play.
Plays the sound provided as input, and makes sure that no other sound plays at the exact same time. (Try two play's right after each other.)
|
getLength
|
getLength(sound):
sound: the sound you want to find the length of.
returns: the number of samples in sound.
Takes a sound as input and returns the number of samples in that sound.
|
getSample
|
getSample(sample):
sample: A Sample, a sample of a sound.
returns: The integer value of that sample.
Takes a Sample object and returns its value (between -32000 and 32000)
|
getSampleObjectAt
|
getSampleObjectAt(sound, index):
sound: A Sound, the sound you want to get the sample from.
index: An Integer, the index value of the sample you want to get.
returns: The sample object at that index.
Takes a sound and an index (an integer value), and returns the Sample object at that index
|
getSamples
|
getSamples(sound):
sound: A Sound, the sound you want to extract the samples from
returns: A collection of all the samples in the sound
Takes a sound as input and returns the Samples in that sound.
|
getSampleValueAt
|
getSampleValueAt(sound, index):
sound: A Sound, the sound you want to use the sample from.
index: An Integer, the index of the sample you want to get the value of.
Takes a sound and an index (an integer value), and returns the value of the sample (between -32000 and 32000) for that object.
|
getSamplingRate
|
getSamplingRate(sound):
sound: A Sound, the sound you want to get the sampling rate from.
returns: An Integer representing the number of samples per second.
Takes a sound as input and returns the number representing the number of samples in each second for the sound
|
getSound
|
getSound(sample):
sample: A Sample, a sample belonging to a sound.
return: A Sound, the sound the sample belongs to.
Takes a Sample object and returns the Sound that it remembers as its own.
|
makeEmptySound |
makeEmptySound(duration):
duration: An integer, time in seconds for duration of sound
returns: An Empty Sound.
Takes a duration in secounds as sinput and returns the empty sound.
|
makeSound |
makeSound(path):
path: A String, a path to a wav file.
returns: A Sound, created from the file at the given path.
Takes a filename as input, reads the file, and creates a sound from it. Returns the sound.
|
pickAFile |
pickAFile():
returns: A String, the path to the file chosen in the dialog box.
Lets the user pick a file and returns the complete path name as a string. No input.
|
play |
play(A Sound):
sound: the sound you want to be played.
Plays a sound provided as input. No return value.
|
playNote |
playNote(note, duration, intensity):
note: the note (a number > 0) you want to be played.
duration: the duration you want the note to be played in milliseconds.
intensity: the intensity (a number between 0 and 127) you want the note to be played.
Plays a note. No return value
|
playAtRate |
playAtRate(sound, rate):
sound: A Sound, the sound you want to be played.
rate: A Number, the rate you want the sound to be played.
Takes a sound and a rate (1.0 means normal speed, 2.0 is twice as fast, and 0.5 is half as fast), and plays the sound at that rate. The duration is always the same, e.g., if you play it twice as fast, the sound plays twice to fill the given time.
|
playAtRateDur |
playAtRateDur(sound, rate, duration):
sound: A Sound, the sound you want to be played.
rate: A Number, the rate at which you want the sound to be played.
duration: A Number, the number of samples you want to be played.
Takes a sound and a rate (1.0 means normal speed, 2.0 is twice as fast, and 0.5 is half as fast), and plays the sound at that rate. The duration is the number of sample to play.
|
playInRange |
playInRange(sound, start, stop):
sound: A Sound, the sound you want to play a piece of.
start: A Number, the index of the sound you want the playback to start.
stop: A Number, the index of the sound you want the playback to stop.
Take a sound, a start index, and a stop index and plays a selection of the sound defined by the start and stop indexes.
|
setSample
|
setSample(sample, value):
sample: A Sample, the sound sample tou want to change the value of.
value: An Integer, the value you want to set the sample to.
Takes a Sample object and a value, and sets the sample to that value.
|
setSampleValueAt |
setSampleValueAt(sound, index, value):
sound: A Sound, the sound you want to change a sample in.
index: An Integer, the index of the sample you want to set.
value: An Integer, the new value of the sample you want to set.
Takes a sound, an index, and a value (should be between -32000 and 32000), and sets the value of the sample at the given index in the given sound to the given value.
|
writeSoundTo |
writeSoundTo(sound, filename):
sound: A Sound, the sound you want to write out to a file.
filename: A String, the path of the location you want to write the sound.
Takes a sound and a filename (a string) and writes the sound to that file as a WAV file. (Make sure that the filename ends in .wav if you want the operating system to treat it right.) |