zombie.core.sound
Interface Sound

All Known Implementing Classes:
Buffer, Stream

public interface Sound

Describes a type of sound: its default gain, pitch, looping, priority, and the URL to obtain the Ogg Vorbis data that defines it.


Method Summary
 Attenuator getAttenuator()
          Returns the Attenuator to use for this Sound.
 int getFormat()
           
 float getGain()
          Returns the gain.
 float getPitch()
          Returns the pitch.
 int getPriority()
          Returns the priority.
 java.lang.String getURL()
           
 boolean isLooped()
          Returns looped status
 boolean isStereo()
           
 void setAttenuator(Attenuator attenuator)
          Sets the Attenuator to use for this Sound.
 void setGain(float gain)
          Sets the default gain for this buffer
 void setLooped(boolean looped)
          Sets whether this buffer should be looped by default
 void setPitch(float pitch)
          Sets the default pitch for this buffer
 void setPriority(int priority)
          Sets the default priority for this buffer relative to all other buffers.
 void setURL(java.lang.String url)
          Sets the URL from where this AbstractSound will read Ogg Vorbis data
 

Method Detail

setGain

void setGain(float gain)
Sets the default gain for this buffer

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

setPitch

void setPitch(float pitch)
Sets the default pitch for this buffer

Parameters:
pitch - (must be > 0.0f)

setPriority

void setPriority(int priority)
Sets the default priority for this buffer relative to all other buffers.

Parameters:
priority - (must be >= 0)

setLooped

void setLooped(boolean looped)
Sets whether this buffer should be looped by default

Parameters:
looped -

setURL

void setURL(java.lang.String url)
Sets the URL from where this AbstractSound will read Ogg Vorbis data

Parameters:
url - May ne null

getGain

float getGain()
Returns the gain. Gain defaults to 1.0f

Returns:
float (≥0.0f and ≤1.0f)

getPitch

float getPitch()
Returns the pitch. Pitch defaults to 1.0f

Returns:
float (>0.0f)

getPriority

int getPriority()
Returns the priority. Priority defaults to 0.

Returns:
int

isLooped

boolean isLooped()
Returns looped status

Returns:
boolean

getAttenuator

Attenuator getAttenuator()
Returns the Attenuator to use for this Sound. The default Attenuator is specified by the SoundEngine itself, so if no attenuator has been set with setAttenuator(Attenuator) then the default returned by SoundEngine.getDefaultAttenuator() will be used instead when playing the sound.

Returns:
an Attenuator (never null)
See Also:
setAttenuator(Attenuator), SoundEngine.getDefaultAttenuator()

setAttenuator

void setAttenuator(Attenuator attenuator)
Sets the Attenuator to use for this Sound. If set to null, then the default attenuator as returned by SoundEngine.getDefaultAttenuator() will be used when playing this sound.

Parameters:
attenuator - May be null
See Also:
getAttenuator(), SoundEngine.getDefaultAttenuator()

getURL

java.lang.String getURL()
Returns:
Returns the url.

getFormat

int getFormat()
Returns:
the OpenAL format

isStereo

boolean isStereo()
Returns:
true if the sound is stereo