com.groovemanager.spi.asio
Class ASIOAudioFormat

java.lang.Object
  extended by javax.sound.sampled.AudioFormat
      extended by com.groovemanager.spi.asio.ASIOAudioFormat

final class ASIOAudioFormat
extends javax.sound.sampled.AudioFormat

This class maps the ASIOSampleType values to a JavaSound AudioFormat

Author:
Manu Robledo

Nested Class Summary
(package private) static class ASIOAudioFormat.Encoding
           
 
Field Summary
 
Fields inherited from class javax.sound.sampled.AudioFormat
bigEndian, channels, encoding, frameRate, frameSize, sampleRate, sampleSizeInBits
 
Constructor Summary
ASIOAudioFormat(float sampleRate, int type, int channels)
          Constructs a new ASIOAudioFormat of the specified ASIOSampleType, with the given sampleRate and channels
 
Method Summary
private static javax.sound.sampled.AudioFormat.Encoding getEncoding(int type)
          Get the Encoding out of the given ASIOSampleType
private static boolean getEndianess(int type)
          Get the endianess out of the given ASIOSampleType
private static int getFrameSize(int type, int channels)
          Get the frame size out of the given ASIOSampleType
private static int getSampleSizeInBits(int type)
          Get the sample size out of the given ASIOSampleType
 
Methods inherited from class javax.sound.sampled.AudioFormat
getChannels, getEncoding, getFrameRate, getFrameSize, getProperty, getSampleRate, getSampleSizeInBits, isBigEndian, matches, properties, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ASIOAudioFormat

ASIOAudioFormat(float sampleRate,
                int type,
                int channels)
Constructs a new ASIOAudioFormat of the specified ASIOSampleType, with the given sampleRate and channels

Parameters:
sampleRate - The sampleRate of the format
type - The ASIOSampleType constant
channels - The number of channels
Method Detail

getEncoding

private static javax.sound.sampled.AudioFormat.Encoding getEncoding(int type)
Get the Encoding out of the given ASIOSampleType

Parameters:
type - The ASIOSampleType constant
Returns:
The encoding of the given ASIOSampleType. For Flaot encodings normalized to +/- 1.0 PCM_FLOAT is used as encoding name (either 32 or 64 Bit are supported)

getEndianess

private static boolean getEndianess(int type)
Get the endianess out of the given ASIOSampleType

Parameters:
type - The ASIOSampleType constant
Returns:
The endianess of the given ASIOSampleType

getFrameSize

private static int getFrameSize(int type,
                                int channels)
Get the frame size out of the given ASIOSampleType

Parameters:
type - The ASIOSampleType constant
channels - The number of channels
Returns:
The frame size in Bits of the given ASIOSampleType

getSampleSizeInBits

private static int getSampleSizeInBits(int type)
Get the sample size out of the given ASIOSampleType

Parameters:
type - The ASIOSampleType constant
Returns:
The sample size in Bits of the given ASIOSampleType