Class WaveLoader

java.lang.Object
de.pottgames.tuningfork.WaveLoader

public abstract class WaveLoader extends Object
  • Constructor Details

    • WaveLoader

      public WaveLoader()
  • Method Details

    • load

      public static SoundBuffer load(File file)
      Loads a wav file into a SoundBuffer.
      Parameters:
      file - the file
      Returns:
      the SoundBuffer
    • loadReadable

      public static ReadableSoundBuffer loadReadable(File file)
      Loads a wav file into a ReadableSoundBuffer.
      Parameters:
      file - the file
      Returns:
      the SoundBuffer
    • load

      public static SoundBuffer load(File file, boolean useJavaDecoder)
      Loads a wav file into a SoundBuffer.
      Parameters:
      file - the file
      useJavaDecoder - enforces the java decoder instead of the native one
      Returns:
      the SoundBuffer
    • loadReadable

      public static ReadableSoundBuffer loadReadable(File file, boolean useJavaDecoder)
      Loads a wav file into a ReadableSoundBuffer.
      Parameters:
      file - the file
      useJavaDecoder - enforces the java decoder instead of the native one
      Returns:
      the SoundBuffer
    • load

      public static SoundBuffer load(com.badlogic.gdx.files.FileHandle file)
      Loads a wav file into a SoundBuffer.
      Parameters:
      file - the file handle
      Returns:
      the SoundBuffer
    • loadReadable

      public static ReadableSoundBuffer loadReadable(com.badlogic.gdx.files.FileHandle file)
      Loads a wav file into a ReadableSoundBuffer.
      Parameters:
      file - the file handle
      Returns:
      the SoundBuffer
    • load

      public static SoundBuffer load(com.badlogic.gdx.files.FileHandle file, boolean useJavaDecoder)
      Loads a wav file into a SoundBuffer.
      Parameters:
      file - the file handle
      useJavaDecoder - enforces the java decoder instead of the native one
      Returns:
      the SoundBuffer
    • loadReadable

      public static ReadableSoundBuffer loadReadable(com.badlogic.gdx.files.FileHandle file, boolean useJavaDecoder)
      Loads a wav file into a ReadableSoundBuffer.
      Parameters:
      file - the file handle
      useJavaDecoder - enforces the java decoder instead of the native one
      Returns:
      the SoundBuffer
    • load

      public static SoundBuffer load(InputStream stream)
      Loads a SoundBuffer from an InputStream and closes it afterward.
      Parameters:
      stream - the input stream
      Returns:
      the SoundBuffer
    • loadReadable

      public static ReadableSoundBuffer loadReadable(InputStream stream)
      Loads a ReadableSoundBuffer from an InputStream and closes it afterward.
      Parameters:
      stream - the input stream
      Returns:
      the SoundBuffer
    • load

      public static SoundBuffer load(WavInputStream input)
      Loads a SoundBuffer from a WavInputStream.
      Parameters:
      input - the WavInputStream
      Returns:
      the SoundBuffer
    • loadReadable

      public static ReadableSoundBuffer loadReadable(WavInputStream input)
      Parameters:
      input - the WavInputStream
      Returns:
      the SoundBuffer
    • loadFastImaAdpcm

      public static SoundBuffer loadFastImaAdpcm(String path)
      Disclaimer: This is a special use case load method. If you just want to load a wav, no matter what encoding, use one of the other load methods.

      Loads an IMA ADPCM encoded wav file into a SoundBuffer. The file must be present on the file system (not packed into a jar), be careful with this as packing everything is libGDXs default behavior. Loading is completely done in native code and therefore a bit faster. Leads to a crash when fed with a wav file that is not IMA ADPCM encoded.
      Parameters:
      path - must be a file that exists on the file system
      Returns:
      the SoundBuffer
    • loadFastImaAdpcmReadable

      public static SoundBuffer loadFastImaAdpcmReadable(String path)
      Disclaimer: This is a special use case load method. If you just want to load a wav, no matter what encoding, use one of the other load methods.

      Loads an IMA ADPCM encoded wav file into a ReadableSoundBuffer. The file must be present on the file system (not packed into a jar), be careful with this as packing everything is libGDXs default behavior. Loading is completely done in native code and therefore a bit faster. Leads to a crash when fed with a wav file that is not IMA ADPCM encoded.
      Parameters:
      path - must be a file that exists on the file system
      Returns:
      the SoundBuffer
    • loadReverse

      public static SoundBuffer loadReverse(com.badlogic.gdx.files.FileHandle file)
      Loads a wav file in reverse into a SoundBuffer.
      Parameters:
      file - the file handle
      Returns:
      the SoundBuffer
    • loadReadableReverse

      public static ReadableSoundBuffer loadReadableReverse(com.badlogic.gdx.files.FileHandle file)
      Loads a wav file in reverse into a ReadableSoundBuffer.
      Parameters:
      file - the file handle
      Returns:
      the SoundBuffer