sdljava.audio
Class SDLAudioSpec

java.lang.Object
  extended by sdljava.audio.SDLAudioSpec

public class SDLAudioSpec
extends java.lang.Object

The SDL_AudioSpec structure is used to describe the format of some audio data. This structure is used by SDL_OpenAudio and SDL_LoadWAV. While all fields are used by SDL_OpenAudio, only freq, format, samples and channels are used by SDL_LoadWAV.

Version:
$Id: SDLAudioSpec.java,v 1.5 2004/12/29 19:11:52 ivan_ganza Exp $

Field Summary
(package private)  SDL_AudioSpec swigAudioSpec
           
 
Constructor Summary
SDLAudioSpec()
           
 
Method Summary
 short getChannels()
           
 int getFormat()
           
 int getFreq()
           
 int getSamples()
           
 short getSilence()
           
 long getSize()
           
 SDL_AudioSpec getSwigAudioSpec()
          Gets the value of swigAudioSpec
 void setChannels(int channels)
          Set number of channels (1-mono, 2-stereo)
 void setFormat(int format)
          Set Audio data format
 void setFreq(int freq)
          Set Audio frequency in samples per second
 void setSamples(int samples)
          Set Audio buffer size in samples
 void setSwigAudioSpec(SDL_AudioSpec argSwigAudioSpec)
          Sets the value of swigAudioSpec
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

swigAudioSpec

SDL_AudioSpec swigAudioSpec
Constructor Detail

SDLAudioSpec

public SDLAudioSpec()
Method Detail

getSwigAudioSpec

public SDL_AudioSpec getSwigAudioSpec()
Gets the value of swigAudioSpec

Returns:
the value of swigAudioSpec

setSwigAudioSpec

public void setSwigAudioSpec(SDL_AudioSpec argSwigAudioSpec)
Sets the value of swigAudioSpec

Parameters:
argSwigAudioSpec - Value to assign to this.swigAudioSpec

setFreq

public void setFreq(int freq)
Set Audio frequency in samples per second

Parameters:
freq - an int value

getFreq

public int getFreq()
Returns:
Audio frequency in samples per second

setFormat

public void setFormat(int format)
Set Audio data format

Parameters:
format - an int value

getFormat

public int getFormat()
Returns:
The current Audio data format

setChannels

public void setChannels(int channels)
Set number of channels (1-mono, 2-stereo)

Parameters:
channels - a short value

getChannels

public short getChannels()
Returns:
Number of audio channels (1-mono, 2-stereo)

getSilence

public short getSilence()
Returns:
Audio buffer silence value (calculated)

setSamples

public void setSamples(int samples)
Set Audio buffer size in samples

Parameters:
samples - an int value

getSamples

public int getSamples()
Returns:
Audio buffer size in samples

getSize

public long getSize()
Returns:
Audio buffer size in bytes (calculated)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object