|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SimpleSound Sound
public class Sound
Class that represents a sound. This class is used by the students to extend the capabilities of SimpleSound.
Field Summary |
---|
Fields inherited from class SimpleSound |
---|
MAX_NEG, MAX_POS |
Constructor Summary | |
---|---|
Sound(int numSeconds)
Constructor that takes the number of seconds that this sound will have |
|
Sound(Sound copySound)
Constructor that makes a copy of the passed sound |
|
Sound(String fileName)
Constructor that takes a file name |
Method Summary | |
---|---|
Sound |
append(Sound appendSound)
Return this sound appended with the input sound |
void |
delete(int start,
int end)
Delete from start to end in this sound |
void |
increaseVolume(double factor)
Increase the volume of a sound |
void |
insertAfter(Sound inSound,
int start)
insert the input Sound after the nth sample (input integer). |
Sound |
mix(Sound mixIn,
double ratio)
Mix the input sound with this sound, with percent ratio of input. |
Sound |
portion(int start,
int end)
Return part of a sound |
Sound |
reverse()
Method to reverse a sound. |
Sound |
scale(double factor)
Scale up or down a sound by the given factor (1.0 returns the same, 2.0 doubles the length, and 0.5 halves the length) |
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 |
---|
public Sound(String fileName)
fileName
- the name of the file to read the sound frompublic Sound(int numSeconds)
numSeconds
- the number of seconds desiredpublic Sound(Sound copySound)
copySound
- the sound to copyMethod Detail |
---|
public String toString()
toString
in class SimpleSound
public void increaseVolume(double factor)
public Sound reverse()
public Sound append(Sound appendSound)
appendSound
- sound to append to thispublic Sound mix(Sound mixIn, double ratio)
mixIn
- sound to mix inratio
- how much of input mixIn to mix inpublic Sound scale(double factor)
factor
- ratio to increase or decreasepublic void insertAfter(Sound inSound, int start)
inSound
- Sound to insertstart
- index where to start inserting the new soundpublic void delete(int start, int end)
start
- where to start deletionend
- where to stop deletionpublic Sound portion(int start, int end)
start
- where to start returningend
- where to end returning
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |