|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectauditory.sampled.BufferedSoundFactory
public class BufferedSoundFactory
A utility class that can be used to create BufferedSound objects in various ways. Notes: One millisecond is 1/1,000 of a second One microsecond is 1/1,000,000 of a second
Constructor Summary | |
---|---|
BufferedSoundFactory()
Default Constructor |
|
BufferedSoundFactory(ResourceFinder finder)
Explicit Value Constructor |
Method Summary | |
---|---|
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 The length of the sound is measured in microseconds to be consistent with the Clip interface |
BufferedSound |
createBufferedSound(java.lang.String name)
Create a BufferedSound from a resource/file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BufferedSoundFactory()
public BufferedSoundFactory(ResourceFinder finder)
finder
- The ResourceFinder to use (if needed)Method Detail |
---|
public BufferedSound createBufferedSound(double frequency, int length, float sampleRate, double amplitude)
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 resource
java.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 from
java.io.IOException
javax.sound.sampled.UnsupportedAudioFileException
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |