zombie.openal
Interface Audio

All Known Implementing Classes:
AudioImpl, DeferredSound, MODSound, NullAudio, StreamSound

public interface Audio

The description of of audio data loaded by the AudioLoader

Author:
kevin, Nathan Sweet

Method Summary
 int getBufferID()
          get the ID of the OpenAL buffer holding this data (if any).
 float getPosition()
          Return the current playing position in the sound
 boolean isPlaying()
          Check if the sound is playing as sound fx
 int playAsMusic(float pitch, float gain, boolean loop)
          Play this sound as music
 int playAsSoundEffect(float pitch, float gain, boolean loop)
          Play this sound as a sound effect
 int playAsSoundEffect(float pitch, float gain, boolean loop, float x, float y, float z, float radius)
          Play this sound as a sound effect
 int playAsSoundEffectUnbuffered(float pitch, float gain, boolean loop)
           
 void setID(int id)
           
 boolean setPosition(float position)
          Seeks to a position in the music.
 boolean setPosition(float x, float y, float z)
           
 void setRange(float radius)
           
 void setVolume(float volume)
           
 void stop()
          Stop the sound effect
 

Method Detail

getBufferID

int getBufferID()
get the ID of the OpenAL buffer holding this data (if any). This method is not valid with streaming resources.

Returns:
The ID of the OpenAL buffer holding this data

getPosition

float getPosition()
Return the current playing position in the sound

Returns:
The current position in seconds.

isPlaying

boolean isPlaying()
Check if the sound is playing as sound fx

Returns:
True if the sound is playing

playAsMusic

int playAsMusic(float pitch,
                float gain,
                boolean loop)
Play this sound as music

Parameters:
pitch - The pitch of the play back
gain - The gain of the play back
loop - True if we should loop
Returns:
The ID of the source playing the sound

playAsSoundEffect

int playAsSoundEffect(float pitch,
                      float gain,
                      boolean loop)
Play this sound as a sound effect

Parameters:
pitch - The pitch of the play back
gain - The gain of the play back
loop - True if we should loop
Returns:
The ID of the source playing the sound

playAsSoundEffect

int playAsSoundEffect(float pitch,
                      float gain,
                      boolean loop,
                      float x,
                      float y,
                      float z,
                      float radius)
Play this sound as a sound effect

Parameters:
pitch - The pitch of the play back
gain - The gain of the play back
loop - True if we should loop
x - The x position of the sound
y - The y position of the sound
z - The z position of the sound
Returns:
The ID of the source playing the sound

setID

void setID(int id)

setPosition

boolean setPosition(float position)
Seeks to a position in the music.

Parameters:
position - Position in seconds.
Returns:
True if the setting of the position was successful

setPosition

boolean setPosition(float x,
                    float y,
                    float z)

setVolume

void setVolume(float volume)

stop

void stop()
Stop the sound effect


playAsSoundEffectUnbuffered

int playAsSoundEffectUnbuffered(float pitch,
                                float gain,
                                boolean loop)

setRange

void setRange(float radius)