public class BufferedSoundFactory
extends java.lang.Object
Constructor and Description |
---|
BufferedSoundFactory()
Default Constructor.
|
BufferedSoundFactory(ResourceFinder finder)
Explicit Value Constructor.
|
Modifier and Type | Method and Description |
---|---|
BufferedSound |
createBufferedSound(javax.sound.sampled.AudioInputStream inStream)
Create a BufferedSound from an AudioInputStream.
|
BufferedSound |
createBufferedSound(double frequency,
int length,
float sampleRate,
double amplitude)
Create a BufferedSound from a sine wave with a
particular frequency.
|
BufferedSound |
createBufferedSound(java.lang.String name)
Create a BufferedSound from a resource/file.
|
public BufferedSoundFactory()
public BufferedSoundFactory(ResourceFinder finder)
finder
- The ResourceFinder to use (if needed)public BufferedSound createBufferedSound(double frequency, int length, float sampleRate, double amplitude)
The length of the sound is measured in microseconds to be consistent with the Clip interface.
frequency
- The frequency of the wave (in Hz)length
- The length of the sound (in microseconds)sampleRate
- The number of samples per secondamplitude
- The maximum amplitude of the wave in [0.0, 32767.0]public BufferedSound createBufferedSound(java.lang.String name) throws java.io.IOException, javax.sound.sampled.UnsupportedAudioFileException
name
- The name of the resourcejava.io.IOException
javax.sound.sampled.UnsupportedAudioFileException
public BufferedSound createBufferedSound(javax.sound.sampled.AudioInputStream inStream) throws java.io.IOException, javax.sound.sampled.UnsupportedAudioFileException
inStream
- The stream to read fromjava.io.IOException
javax.sound.sampled.UnsupportedAudioFileException