Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.newdawn.slick.openal
Class MODSound

    java.lang.Object
      org.newdawn.slick.openal.AudioImpl
          org.newdawn.slick.openal.MODSound

All Implemented Interfaces:
  Audio

    public class MODSound

extends AudioImpl

A sound as a MOD file - can only be played as music

Author:
  Kevin Glass

Constructor Summary
`MODSound(SoundStore store, java.io.InputStream in)` Create a mod sound to be played back

Method Summary
`float` | `getPosition()` Return the current playing position in the sound
`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
`void` | `poll()` Poll the streaming on the MOD
`boolean` | `setPosition(float position)` Seeks to a position in the music.
`void` | `stop()` Stop the sound effect

Methods inherited from class org.newdawn.slick.openal.AudioImpl
`getBufferID, isPlaying, pauseMusic, playAsSoundEffect, restartMusic`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MODSound

    public MODSound(SoundStore store,
                    java.io.InputStream in)
             throws java.io.IOException

  Create a mod sound to be played back

  Parameters:
    `store` - The store this sound belongs to
    `in` - The input stream to read the data from
  Throws:
    `java.io.IOException` - Indicates a failure to load a sound

Method Detail

### playAsMusic

    public int playAsMusic(float pitch,
                           float gain,
                           boolean loop)

  Description copied from interface: `Audio`
  Play this sound as music

  Specified by:
    `playAsMusic` in interface `Audio`
  Overrides:
    `playAsMusic` in class `AudioImpl`
  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
  See Also:
    `AudioImpl.playAsMusic(float, float, boolean)`

### poll

    public void poll()

  Poll the streaming on the MOD

### playAsSoundEffect

    public int playAsSoundEffect(float pitch,
                                 float gain,
                                 boolean loop)

  Description copied from interface: `Audio`
  Play this sound as a sound effect

  Specified by:
    `playAsSoundEffect` in interface `Audio`
  Overrides:
    `playAsSoundEffect` in class `AudioImpl`
  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
  See Also:
    `AudioImpl.playAsSoundEffect(float, float, boolean)`

### stop

    public void stop()

  Description copied from interface: `Audio`
  Stop the sound effect

  Specified by:
    `stop` in interface `Audio`
  Overrides:
    `stop` in class `AudioImpl`
  See Also:
    `AudioImpl.stop()`

### getPosition

    public float getPosition()

  Description copied from interface: `Audio`
  Return the current playing position in the sound

  Specified by:
    `getPosition` in interface `Audio`
  Overrides:
    `getPosition` in class `AudioImpl`
  Returns:
    The current position in seconds.
  See Also:
    `AudioImpl.getPosition()`

### setPosition

    public boolean setPosition(float position)

  Description copied from interface: `Audio`
  Seeks to a position in the music.

  Specified by:
    `setPosition` in interface `Audio`
  Overrides:
    `setPosition` in class `AudioImpl`
  Parameters:
    `position` - Position in seconds.
  Returns:
    True if the setting of the position was successful
  See Also:
    `AudioImpl.setPosition(float)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006 New Dawn Software. All Rights Reserved.