ch.aplu.util
Class SoundPlayerExt

java.lang.Object
  extended by ch.aplu.util.SoundPlayer
      extended by ch.aplu.util.SoundPlayerExt

public class SoundPlayerExt
extends SoundPlayer

Class for playing sound files using file streaming in a separate thread. Sound format supported: WAV (PCM_SIGNED), MP3 (Layer 1,2,3)

MP3 decoder from JavaLayer distributed by SourceForge.net. The following jar files (or later versions) must reside in the classpath:
- jl1.0.1.jar
- mp3spi1.9.4.jar
- tritonius_share.jar
Download from www.javazoom.net or www.sourceforge.net.
Download of redistribution from www.aplu.ch/mp3support. With thanks to the authors.


Constructor Summary
SoundPlayerExt(java.io.File audioFile)
          Same as SoundPlayerEx(audioFile, mixerIndex) using the default sound device.
SoundPlayerExt(java.io.File audioFile, int nbMixer)
          Construct a sound player attached to given File instance using the given mixer index (sound device).
SoundPlayerExt(java.lang.Object resourceObj, java.lang.String audioPathname)
          Same as SoundPlayerExt(obj, audioPathname, mixerIndex) using the default sound device.
SoundPlayerExt(java.lang.Object resourceObj, java.lang.String audioPathname, int mixerIndex)
          Construct a sound player attached to given pathname from a JAR archive using the given mixer index (sound device).
SoundPlayerExt(java.lang.String audioPathname)
          Same as SoundPlayerEx(audioPathname, mixerIndex) using the default sound device.
SoundPlayerExt(java.lang.String audioPathname, int nbMixer)
          Construct a sound player attached to given pathname (relative or fully qualified) using the given mixer index (sound device).
SoundPlayerExt(java.net.URL url)
          Same as SoundPlayerEx(url, mixerIndex) using the default sound device.
SoundPlayerExt(java.net.URL url, int nbMixer)
          Construct a sound player attached to given URL using the given mixer index (sound device).
 
Method Summary
 java.lang.String getMP3Info()
          Return string with extended MP3 file information.
 
Methods inherited from class ch.aplu.util.SoundPlayer
addSoundConverter, addSoundPlayerListener, advanceFrames, advanceTime, getAvailableMixers, getCurrentPos, getCurrentTime, getFormat, getFrameRate, getFrameSize, getMixerIndex, getVolume, isPlaying, mute, pause, play, playLoop, replay, rewindFrames, rewindTime, setVolume, stop
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoundPlayerExt

public SoundPlayerExt(java.lang.Object resourceObj,
                      java.lang.String audioPathname,
                      int mixerIndex)
Construct a sound player attached to given pathname from a JAR archive using the given mixer index (sound device). The class loader of the specified object is used.


SoundPlayerExt

public SoundPlayerExt(java.lang.Object resourceObj,
                      java.lang.String audioPathname)
Same as SoundPlayerExt(obj, audioPathname, mixerIndex) using the default sound device.


SoundPlayerExt

public SoundPlayerExt(java.net.URL url)
Same as SoundPlayerEx(url, mixerIndex) using the default sound device.


SoundPlayerExt

public SoundPlayerExt(java.net.URL url,
                      int nbMixer)
Construct a sound player attached to given URL using the given mixer index (sound device). To find the mixer indices of all installed sound devices call getAvailableMixers().
Normally an installed sound device has two entries, one for playing and one for recording. You must use the index for the playing device. To load a resource from a jar file use java.net.URL url = getClass().getResource(""), e.g. java.net.URL url = getClass().getResource("wav/mysound.wav");

Throws:
java.lang.IllegalArgumentException - if sound resource or sound system is unavailable.

SoundPlayerExt

public SoundPlayerExt(java.io.File audioFile)
Same as SoundPlayerEx(audioFile, mixerIndex) using the default sound device.


SoundPlayerExt

public SoundPlayerExt(java.io.File audioFile,
                      int nbMixer)
Construct a sound player attached to given File instance using the given mixer index (sound device). To find the mixer indices of all installed sound devices call getAvailableMixers().

Throws:
java.lang.RuntimeException - if sound initialization fails

SoundPlayerExt

public SoundPlayerExt(java.lang.String audioPathname)
Same as SoundPlayerEx(audioPathname, mixerIndex) using the default sound device.


SoundPlayerExt

public SoundPlayerExt(java.lang.String audioPathname,
                      int nbMixer)
Construct a sound player attached to given pathname (relative or fully qualified) using the given mixer index (sound device). To find the mixer indices of all installed sound devices call getAvailableMixers().

Throws:
java.lang.RuntimeException - if sound initialization fails
Method Detail

getMP3Info

public java.lang.String getMP3Info()
Return string with extended MP3 file information.