org.xith3d.loaders.sound
Class SoundLoader

java.lang.Object
  extended by org.xith3d.loaders.sound.SoundLoader
Direct Known Subclasses:
ExtensionSoundLoader, MidiLoader, OggLoader, WaveLoader

public abstract class SoundLoader
extends java.lang.Object

This is a base for other SoundLoader implementations for different formats.


Constructor Summary
SoundLoader()
           
 
Method Summary
static SoundLoader getInstance()
           
 BackgroundSound loadBackgroundSound(java.io.InputStream in, float gain)
          This method loads a BackgroundSound from an InputStream.
 BackgroundSound loadBackgroundSound(java.lang.String filename, float gain)
          This method loads a BackgroundSound from a file.
 BackgroundSound loadBackgroundSound(java.net.URL url, float gain)
          This method loads a BackgroundSound from a URL.
 PointSound loadPointSound(java.io.InputStream in, float gain)
          This method loads a PointSound from an InputStream.
 PointSound loadPointSound(java.lang.String filename, float gain)
          This method loads a PointSound from a file.
 PointSound loadPointSound(java.net.URL url, float gain)
          This method loads a PointSound from a URL.
abstract  SoundContainer loadSound(java.io.InputStream in)
          This method loads the Sound from an InputStream.
abstract  SoundContainer loadSound(java.lang.String filename)
          This method loads the Sound from a file.
abstract  SoundContainer loadSound(java.net.URL url)
          This method loads the Sound from a URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoundLoader

public SoundLoader()
Method Detail

getInstance

public static SoundLoader getInstance()
Returns:
the ExtensionSoundLoader instance to use as singleton.

loadSound

public abstract SoundContainer loadSound(java.io.InputStream in)
                                  throws java.io.IOException
This method loads the Sound from an InputStream.

Parameters:
in - the InputStream to load the Sound from. It isn't necessary to explicitly pass an instance of BufferedInputStream, since it is created on demand.
Throws:
java.io.IOException

loadSound

public abstract SoundContainer loadSound(java.net.URL url)
                                  throws java.io.IOException
This method loads the Sound from a URL.

Parameters:
url - the URL to load the Sound from.
Throws:
java.io.IOException

loadSound

public abstract SoundContainer loadSound(java.lang.String filename)
                                  throws java.io.IOException
This method loads the Sound from a file.

Parameters:
filename - the file's name to load the Sound from.
Throws:
java.io.IOException

loadPointSound

public PointSound loadPointSound(java.io.InputStream in,
                                 float gain)
                          throws java.io.IOException
This method loads a PointSound from an InputStream.

Parameters:
in - the InputStream to load the Sound from. It isn't necessary to explicitly pass an instance of BufferedInputStream, since it is created on demand.
Throws:
java.io.IOException

loadPointSound

public PointSound loadPointSound(java.net.URL url,
                                 float gain)
                          throws java.io.IOException
This method loads a PointSound from a URL.

Parameters:
url - the URL to load the Sound from.
Throws:
java.io.IOException

loadPointSound

public PointSound loadPointSound(java.lang.String filename,
                                 float gain)
                          throws java.io.IOException
This method loads a PointSound from a file.

Parameters:
filename - the file's name to load the Sound from.
Throws:
java.io.IOException

loadBackgroundSound

public BackgroundSound loadBackgroundSound(java.io.InputStream in,
                                           float gain)
                                    throws java.io.IOException
This method loads a BackgroundSound from an InputStream.

Parameters:
in - the InputStream to load the Sound from. It isn't necessary to explicitly pass an instance of BufferedInputStream, since it is created on demand.
Throws:
java.io.IOException

loadBackgroundSound

public BackgroundSound loadBackgroundSound(java.net.URL url,
                                           float gain)
                                    throws java.io.IOException
This method loads a BackgroundSound from a URL.

Parameters:
url - the URL to load the Sound from.
Throws:
java.io.IOException

loadBackgroundSound

public BackgroundSound loadBackgroundSound(java.lang.String filename,
                                           float gain)
                                    throws java.io.IOException
This method loads a BackgroundSound from a file.

Parameters:
filename - the file's name to load the Sound from.
Throws:
java.io.IOException