Class OpenALSound

  • All Implemented Interfaces:
    com.badlogic.gdx.audio.Sound, com.badlogic.gdx.utils.Disposable
    Direct Known Subclasses:
    Mp3.Sound, Ogg.Sound, Wav.Sound

    public class OpenALSound
    extends java.lang.Object
    implements com.badlogic.gdx.audio.Sound
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()  
      float duration()
      Returns the length of the sound in seconds.
      int getChannels()
      returns the number of channels of the sound (1 for mono, 2 for stereo).
      int getRate()
      returns the original sample rate of the sound in Hz.
      long loop()  
      long loop​(float volume)  
      long loop​(float volume, float pitch, float pan)  
      void pause()  
      void pause​(long soundId)  
      long play()  
      long play​(float volume)  
      long play​(float volume, float pitch, float pan)  
      void resume()  
      void resume​(long soundId)  
      void setLooping​(long soundId, boolean looping)  
      void setPan​(long soundId, float pan, float volume)  
      void setPitch​(long soundId, float pitch)  
      void setVolume​(long soundId, float volume)  
      void stop()  
      void stop​(long soundId)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • play

        public long play()
        Specified by:
        play in interface com.badlogic.gdx.audio.Sound
      • play

        public long play​(float volume)
        Specified by:
        play in interface com.badlogic.gdx.audio.Sound
      • loop

        public long loop()
        Specified by:
        loop in interface com.badlogic.gdx.audio.Sound
      • loop

        public long loop​(float volume)
        Specified by:
        loop in interface com.badlogic.gdx.audio.Sound
      • stop

        public void stop()
        Specified by:
        stop in interface com.badlogic.gdx.audio.Sound
      • dispose

        public void dispose()
        Specified by:
        dispose in interface com.badlogic.gdx.utils.Disposable
        Specified by:
        dispose in interface com.badlogic.gdx.audio.Sound
      • stop

        public void stop​(long soundId)
        Specified by:
        stop in interface com.badlogic.gdx.audio.Sound
      • pause

        public void pause()
        Specified by:
        pause in interface com.badlogic.gdx.audio.Sound
      • pause

        public void pause​(long soundId)
        Specified by:
        pause in interface com.badlogic.gdx.audio.Sound
      • resume

        public void resume()
        Specified by:
        resume in interface com.badlogic.gdx.audio.Sound
      • resume

        public void resume​(long soundId)
        Specified by:
        resume in interface com.badlogic.gdx.audio.Sound
      • setPitch

        public void setPitch​(long soundId,
                             float pitch)
        Specified by:
        setPitch in interface com.badlogic.gdx.audio.Sound
      • setVolume

        public void setVolume​(long soundId,
                              float volume)
        Specified by:
        setVolume in interface com.badlogic.gdx.audio.Sound
      • setLooping

        public void setLooping​(long soundId,
                               boolean looping)
        Specified by:
        setLooping in interface com.badlogic.gdx.audio.Sound
      • setPan

        public void setPan​(long soundId,
                           float pan,
                           float volume)
        Specified by:
        setPan in interface com.badlogic.gdx.audio.Sound
      • play

        public long play​(float volume,
                         float pitch,
                         float pan)
        Specified by:
        play in interface com.badlogic.gdx.audio.Sound
      • loop

        public long loop​(float volume,
                         float pitch,
                         float pan)
        Specified by:
        loop in interface com.badlogic.gdx.audio.Sound
      • duration

        public float duration()
        Returns the length of the sound in seconds.
      • getRate

        public int getRate()
        returns the original sample rate of the sound in Hz.
      • getChannels

        public int getChannels()
        returns the number of channels of the sound (1 for mono, 2 for stereo).