zombie.core.sound
Interface SoundEffect


public interface SoundEffect

A sound effect that is currently playing.


Method Summary
 float getSamplePosition()
           
 boolean isActive()
          Determines whether this sound effect is still active.
 void pause()
          Pause this sound effect
 void play()
          Play this sound effect
 void rewind()
          Rewind this sound effect.
 void setAttenuator(Attenuator attenuator)
          Specifies how the sound effect should be attenuated.
 void setFade(int duration, float finalGain, boolean stopAtEnd)
          Fade this sound effect in or out to a new gain level over a number of ticks.
 void setGain(float gain)
          Set the gain of this effect
 void setLooped(boolean looped)
          Specifies that the sound effect should be looped or not
 void setPitch(float pitch)
          Set the pitch of this effect
 void setPosition(float x, float y, float z)
          Set the position of this sound effect in world coordinates
 void setRadius(float radius)
           
 void stop()
          Stop this sound effect.
 

Method Detail

setPosition

void setPosition(float x,
                 float y,
                 float z)
Set the position of this sound effect in world coordinates

Parameters:
x -
y -

setGain

void setGain(float gain)
Set the gain of this effect

Parameters:
gain - must be ≥ 0.0f and ≤ 1.0f

setPitch

void setPitch(float pitch)
Set the pitch of this effect

Parameters:
pitch - must be > 0.0f and ≤ 1.0f

play

void play()
Play this sound effect


pause

void pause()
Pause this sound effect


stop

void stop()
Stop this sound effect. It is likely to become inactive after stopping.


rewind

void rewind()
Rewind this sound effect.


setLooped

void setLooped(boolean looped)
Specifies that the sound effect should be looped or not

Parameters:
looped -

setAttenuator

void setAttenuator(Attenuator attenuator)
Specifies how the sound effect should be attenuated. If null is specified, the sound engine's default attenuator is used instead

Parameters:
attenuator - May be null

setFade

void setFade(int duration,
             float finalGain,
             boolean stopAtEnd)
Fade this sound effect in or out to a new gain level over a number of ticks.

Parameters:
duration - The duration, in ticks
finalGain - Must be between 0.0f and 1.0f inclusive
stopAtEnd - Whether to stop() the sound effect when the target gain is reached

isActive

boolean isActive()
Determines whether this sound effect is still active. Sound effects all begin life as active but eventually they finish playing and become inactive, or are forcibly terminated by higher priority sound effects and become inactive that way. Once inactive, all further commands are effectively no-ops.

Returns:
boolean

getSamplePosition

float getSamplePosition()

setRadius

void setRadius(float radius)