direct
Class AudioCommon

java.lang.Object
  extended by direct.AudioCommon

public class AudioCommon
extends java.lang.Object

Common methods for audio examples.


Field Summary
static javax.sound.sampled.AudioInputStream aIn
           
static javax.sound.sampled.LineEvent lineEvent
           
 
Constructor Summary
AudioCommon()
           
 
Method Summary
static void closeLine()
           
static javax.sound.sampled.AudioFileFormat.Type findTargetType(java.lang.String strExtension)
          Trying to get an audio file type for the passed extension.
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.TargetDataLine getTargetDataLine(java.lang.String strMixerName, javax.sound.sampled.AudioFormat audioFormat, int nBufferSize)
          TODO:
static boolean isPcm(javax.sound.sampled.AudioFormat.Encoding encoding)
          Checks if the encoding is PCM.
static boolean isPlaying()
           
static void listMixersAndExit()
          TODO:
static void listMixersAndExit(boolean bPlayback)
          List Mixers.
static void listSupportedTargetTypes()
          TODO:
static void play(javax.sound.sampled.AudioFormat af, float[][] data, int off, int end, boolean waitWhilePlaying)
           
static void play(javax.sound.sampled.AudioInputStream aIn)
           
static void play(javax.sound.sampled.AudioInputStream aIn, javax.sound.sampled.AudioFormat format, boolean waitWhilePlaying)
           
static void play(javax.sound.sampled.AudioInputStream aIn, boolean waitWhilePlaying)
           
static void play(int[][] data, double FS)
           
static void play(int[][] data, double FS, boolean waitWhilePlaying)
           
static void play(int[][] data, double FS, int off, int end)
           
static void play(int[][] data, double FS, int off, int end, boolean waitWhilePlaying)
           
static void play(java.lang.String failas)
           
static void play(java.lang.String failas, boolean waitWhilePlaying)
           
static void setDebug(boolean bDebug)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

aIn

public static javax.sound.sampled.AudioInputStream aIn

lineEvent

public static javax.sound.sampled.LineEvent lineEvent
Constructor Detail

AudioCommon

public AudioCommon()
Method Detail

setDebug

public static void setDebug(boolean bDebug)

listSupportedTargetTypes

public static void listSupportedTargetTypes()
TODO:


findTargetType

public static javax.sound.sampled.AudioFileFormat.Type findTargetType(java.lang.String strExtension)
Trying to get an audio file type for the passed extension. This works by examining all available file types. For each type, if the extension this type promisses to handle matches the extension we are trying to find a type for, this type is returned. If no appropriate type is found, null is returned.


listMixersAndExit

public static void listMixersAndExit()
TODO:


listMixersAndExit

public static void listMixersAndExit(boolean bPlayback)
List Mixers. Only Mixers that support either TargetDataLines or SourceDataLines are listed, depending on the value of bPlayback.


getMixerInfo

public 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. If no matching Mixer.Info is found, null is returned.


getTargetDataLine

public static javax.sound.sampled.TargetDataLine getTargetDataLine(java.lang.String strMixerName,
                                                                   javax.sound.sampled.AudioFormat audioFormat,
                                                                   int nBufferSize)
TODO:


isPcm

public static boolean isPcm(javax.sound.sampled.AudioFormat.Encoding encoding)
Checks if the encoding is PCM.


play

public static void play(java.lang.String failas)

play

public static void play(java.lang.String failas,
                        boolean waitWhilePlaying)

play

public static void play(javax.sound.sampled.AudioInputStream aIn)

play

public static void play(javax.sound.sampled.AudioInputStream aIn,
                        boolean waitWhilePlaying)

play

public static void play(int[][] data,
                        double FS)

play

public static void play(int[][] data,
                        double FS,
                        boolean waitWhilePlaying)

play

public static void play(int[][] data,
                        double FS,
                        int off,
                        int end)

play

public static void play(int[][] data,
                        double FS,
                        int off,
                        int end,
                        boolean waitWhilePlaying)

play

public static void play(javax.sound.sampled.AudioFormat af,
                        float[][] data,
                        int off,
                        int end,
                        boolean waitWhilePlaying)

play

public static void play(javax.sound.sampled.AudioInputStream aIn,
                        javax.sound.sampled.AudioFormat format,
                        boolean waitWhilePlaying)

closeLine

public static void closeLine()

isPlaying

public static boolean isPlaying()