sound
Class Oscillator
java.lang.Object
sound.Oscillator
public class Oscillator
- extends java.lang.Object
Constructor Summary |
Oscillator(double frequency_,
int length)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Oscillator
public Oscillator(double frequency_,
int length)
beep
public static void beep()
- Plays the system beep. I only put this here because I did not know
where else to put it. After all, it uses the AWT tool kit, and how
does that make any sense?
main
public static void main(java.lang.String[] arg)
testPlayTone
public static void testPlayTone()
asynchronousToneTest
public static void asynchronousToneTest()
testPlayAndDisplayTone
public static void testPlayAndDisplayTone()
playAndDisplayTone
public static void playAndDisplayTone(int frequency)
playTone
public static void playTone(int frequency)
actualFrequency
public double actualFrequency()
debug
public void debug()
getSineWave
public double[] getSineWave()
getSineWave
public static double[] getSineWave(int frequency1,
int frequency2,
long duration)
- Get a tone.
- Parameters:
frequency1
- the first tonefrequency2
- the second toneduration
- the duration, in ms
- Returns:
- an array that ranges from -1 to 1
getSquareWave
public double[] getSquareWave()
getSawWave
public double[] getSawWave()
getTriangleWave
public double[] getTriangleWave()
sign
public int sign(double d)
getDuration
public double getDuration()
getSampleRate
public int getSampleRate()
getFrequency
public double getFrequency()
setModulationIndex
public void setModulationIndex(double I)
setModulationFrequency
public void setModulationFrequency(double fm)
getFM
public double[] getFM()
getAM
public double[] getAM()
testAudioFft
public static void testAudioFft()
testAudioDft
public static void testAudioDft()
mult
public static double[] mult(double[] d,
double a)
add
public static double[] add(double[] a,
double[] b)
playLinearData
public static void playLinearData(double[] d)
throws javax.sound.sampled.LineUnavailableException,
java.io.IOException
- Throws:
javax.sound.sampled.LineUnavailableException
java.io.IOException
playInputStream
public static void playInputStream(java.io.InputStream bis)
throws javax.sound.sampled.LineUnavailableException,
java.io.IOException
- Throws:
javax.sound.sampled.LineUnavailableException
java.io.IOException
getAudioFormat
public static javax.sound.sampled.AudioFormat getAudioFormat()