|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsound.SoundUtils
public class SoundUtils
Created by IntelliJ IDEA. User: Douglas Lyon Date: Dec 20, 2004 Time: 6:06:44 PM Copyright DocJava, Inc.
Field Summary | |
---|---|
static javax.sound.midi.MidiChannel[] |
channels
|
static boolean |
DEBUG
|
Constructor Summary | |
---|---|
SoundUtils()
|
Method Summary | |
---|---|
static double[] |
bytesToSamples(byte[] byteArray,
int offset,
int length,
int bytesPerSample,
boolean signedData)
Converts a byte array into an array of samples (a bouble). |
static void |
checkAudio()
|
static javax.media.protocol.DataSource |
createDataSource(javax.media.Format format)
|
static void |
echo(double[] linearSamples)
|
static void |
echo(int numberOfEchos,
double decay,
double[] linearSamples)
|
static javax.sound.sampled.AudioFileFormat.Type |
findTargetType(java.lang.String strExtension)
Trying to get an audio file type for the passed extension. |
static int[] |
get16BitAudioData(javax.sound.sampled.AudioFormat format,
byte[] audioBytes)
|
static javax.sound.sampled.AudioFormat |
get8khzMono8Format()
|
static javax.sound.sampled.AudioFileFormat.Type |
getAudioFileType()
|
static javax.sound.sampled.AudioFormat[] |
getAudioFormats(javax.sound.sampled.Port p)
|
static void |
getAuFilePlayAndDisplay()
|
static javax.media.protocol.DataSource |
getCaptureDataSource(javax.media.format.VideoFormat vf)
|
static javax.media.protocol.DataSource |
getCaptureDataSource(javax.media.format.VideoFormat vf,
javax.media.format.AudioFormat af)
|
static javax.media.CaptureDeviceInfo[] |
getCaptureDeviceList()
|
static javax.media.CaptureDeviceInfo |
getDevice()
|
static double[] |
getDoubleData(javax.sound.sampled.AudioFormat format,
byte[] audioBytes)
|
static javax.sound.sampled.LineListener |
getLineListener()
|
static javax.sound.sampled.Port |
getMicrophonePort()
|
static javax.sound.sampled.Mixer.Info |
getMixer()
|
static javax.sound.sampled.Mixer.Info |
getMixerInfo(java.lang.String strMixerName)
TODO: This method tries to return a Mixer.Info whose name matches the passed name. |
static javax.sound.sampled.AudioFileFormat.Type |
getSourceType()
|
static javax.sound.midi.Synthesizer |
getSynthesizer()
|
static javax.sound.sampled.TargetDataLine |
getTargetDataLine(javax.sound.sampled.Mixer.Info mixerInfo,
javax.sound.sampled.AudioFormat audioFormat,
int nBufferSize)
|
static boolean |
isPcm(javax.sound.sampled.AudioFormat.Encoding encoding)
Checks if the encoding is PCM. |
static void |
listMixersAndExit()
|
static void |
listMixersAndExit(boolean bPlayback)
List Mixers. |
static double[] |
littleEndianBytesToSamples(byte[] data,
int offset,
int length,
int bytesPerSample,
boolean signed)
Converts a little-endian byte array into an array of samples (double). |
static void |
main(java.lang.String[] args)
|
static void |
noteOff(int nNoteNumber)
|
static void |
noteOn(int nNoteNumber,
int nVelocity)
|
static void |
out(java.lang.String strMessage)
TODO: |
static void |
play(int nn)
|
static void |
play(int[] ia,
int dur)
|
static void |
play(int[] ia,
int vel,
int dur)
|
static void |
play(int nn,
int dur)
|
static void |
play(int nn,
int vel,
int dur)
|
static void |
play(javax.sound.midi.Synthesizer synth,
int nNoteNumber,
int nVelocity,
int nDuration)
|
static void |
playSound()
|
static void |
playSound(java.net.URL f)
|
static void |
playThread(int[] ia,
int vel,
int dur)
|
static void |
print(double[] ia)
|
static void |
print(int[] ia)
|
static void |
printAudioFileTargetTypes()
|
static void |
printFormatsOfMicrophone()
|
static void |
printMicrophoneInfo()
|
static void |
printSupportedTargetFileTypes()
|
static void |
showInfoDialog()
|
static void |
sleep(int nDuration)
|
static void |
testPlay()
|
static void |
testPlayClip()
|
static void |
testRecorder()
|
static int[] |
transpose(int[] ia,
int bias)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static javax.sound.midi.MidiChannel[] channels
public static boolean DEBUG
Constructor Detail |
---|
public SoundUtils()
Method Detail |
---|
public static void main(java.lang.String[] args)
public static void printFormatsOfMicrophone()
public static double[] bytesToSamples(byte[] byteArray, int offset, int length, int bytesPerSample, boolean signedData) throws java.lang.ArrayIndexOutOfBoundsException
byteArray
- a byte arrayoffset
- which byte to start fromlength
- how many bytes to convertbytesPerSample
- the number of bytes per samplesignedData
- whether the data is signed
null
if byteArray is of zero
length
java.lang.ArrayIndexOutOfBoundsException
public static double[] littleEndianBytesToSamples(byte[] data, int offset, int length, int bytesPerSample, boolean signed) throws java.lang.ArrayIndexOutOfBoundsException
data
- a byte arrayoffset
- which byte to start fromlength
- how many bytes to convertbytesPerSample
- the number of bytes per samplesigned
- whether the data is signed
null
if byteArray is of zero
length
java.lang.ArrayIndexOutOfBoundsException
public static javax.sound.sampled.LineListener getLineListener()
public static javax.sound.sampled.AudioFormat[] getAudioFormats(javax.sound.sampled.Port p)
public static javax.sound.sampled.Port getMicrophonePort()
public static void listMixersAndExit()
public static javax.sound.sampled.Mixer.Info getMixer()
public static javax.sound.sampled.AudioFileFormat.Type getSourceType()
public static javax.sound.sampled.AudioFileFormat.Type getAudioFileType()
public static void printSupportedTargetFileTypes()
public static void getAuFilePlayAndDisplay()
public static void showInfoDialog()
public static void checkAudio()
public static void play(int[] ia, int vel, int dur)
public static void print(double[] ia)
public static void print(int[] ia)
public static void play(int nn)
public static void play(int nn, int dur)
public static void play(int nn, int vel, int dur)
public static void playThread(int[] ia, int vel, int dur)
public static void play(int[] ia, int dur)
public static int[] transpose(int[] ia, int bias)
public static javax.sound.midi.Synthesizer getSynthesizer()
public static void testRecorder()
public static double[] getDoubleData(javax.sound.sampled.AudioFormat format, byte[] audioBytes)
public static int[] get16BitAudioData(javax.sound.sampled.AudioFormat format, byte[] audioBytes)
public static void echo(double[] linearSamples)
public static void echo(int numberOfEchos, double decay, double[] linearSamples)
public static javax.sound.sampled.AudioFormat get8khzMono8Format()
public static void printMicrophoneInfo()
public static void play(javax.sound.midi.Synthesizer synth, int nNoteNumber, int nVelocity, int nDuration)
public static void noteOff(int nNoteNumber)
public static void noteOn(int nNoteNumber, int nVelocity)
public static void sleep(int nDuration)
public static javax.sound.sampled.Mixer.Info getMixerInfo(java.lang.String strMixerName)
public static void listMixersAndExit(boolean bPlayback)
public static void out(java.lang.String strMessage)
public static javax.sound.sampled.TargetDataLine getTargetDataLine(javax.sound.sampled.Mixer.Info mixerInfo, javax.sound.sampled.AudioFormat audioFormat, int nBufferSize) throws javax.sound.sampled.LineUnavailableException
javax.sound.sampled.LineUnavailableException
public static boolean isPcm(javax.sound.sampled.AudioFormat.Encoding encoding)
public static javax.sound.sampled.AudioFileFormat.Type findTargetType(java.lang.String strExtension)
public static void printAudioFileTargetTypes()
public static void playSound(java.net.URL f)
public static void playSound()
public static void testPlay()
public static void testPlayClip()
public static javax.media.protocol.DataSource getCaptureDataSource(javax.media.format.VideoFormat vf, javax.media.format.AudioFormat af)
public static javax.media.protocol.DataSource getCaptureDataSource(javax.media.format.VideoFormat vf)
public static javax.media.CaptureDeviceInfo getDevice()
public static javax.media.CaptureDeviceInfo[] getCaptureDeviceList()
public static javax.media.protocol.DataSource createDataSource(javax.media.Format format)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |