Package ipsk.audio.synth
Class SineWaveGeneratorSource
- java.lang.Object
-
- ipsk.audio.BasicAudioSource
-
- ipsk.audio.synth.SineWaveGeneratorSource
-
- All Implemented Interfaces:
AudioSource
public class SineWaveGeneratorSource extends BasicAudioSource
Sine wave generator audio source.- Author:
- K.Jaensch, klausj@phonetik.uni-muenchen.de
-
-
Field Summary
-
Fields inherited from interface ipsk.audio.AudioSource
DATA_FLAVOR
-
Fields inherited from class ipsk.audio.BasicAudioSource
frameLengthObj
-
-
Constructor Summary
Constructors Constructor Description SineWaveGeneratorSource(float frequency, float amplitudeFactor, javax.sound.sampled.AudioFormat audioFormat, long length)
Creates an audio source for the given frequency.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.sound.sampled.AudioInputStream
getAudioInputStream()
Returns a new audio input stream.javax.sound.sampled.AudioFormat
getFormat()
long
getFrameLength()
static void
main(java.lang.String[] args)
-
Methods inherited from class ipsk.audio.BasicAudioSource
isRandomAccessible, setAudioFormat, setFrameLength
-
-
-
-
Constructor Detail
-
SineWaveGeneratorSource
public SineWaveGeneratorSource(float frequency, float amplitudeFactor, javax.sound.sampled.AudioFormat audioFormat, long length)
Creates an audio source for the given frequency.- Parameters:
frequency
- frequencyamplitudeFactor
- amplitude factor (0...1)audioFormat
- audio format to encode the sine wavelength
- length of generated wave in sample frames or AudioSystem.NOT_SPECIFIED for infinite generation
-
-
Method Detail
-
getAudioInputStream
public javax.sound.sampled.AudioInputStream getAudioInputStream() throws AudioSourceException
Description copied from interface:AudioSource
Returns a new audio input stream.- Specified by:
getAudioInputStream
in interfaceAudioSource
- Specified by:
getAudioInputStream
in classBasicAudioSource
- Returns:
- a new audio input stream
- Throws:
AudioSourceException
-
getFrameLength
public long getFrameLength() throws AudioSourceException
- Specified by:
getFrameLength
in interfaceAudioSource
- Overrides:
getFrameLength
in classBasicAudioSource
- Throws:
AudioSourceException
-
getFormat
public javax.sound.sampled.AudioFormat getFormat() throws AudioSourceException
- Specified by:
getFormat
in interfaceAudioSource
- Overrides:
getFormat
in classBasicAudioSource
- Throws:
AudioSourceException
-
main
public static void main(java.lang.String[] args)
-
-