public class JavaSoundPlayer extends SoundPlayer
SoundPlayer.Frob, SoundPlayer.SoundType| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CACHE_SIZE
The default clip cache holds 4 megs.
|
DEFAULT, PAN_CENTER, PAN_LEFT, PAN_RIGHT| Constructor and Description |
|---|
JavaSoundPlayer(ResourceManager rmgr)
Constructs a sound manager.
|
JavaSoundPlayer(ResourceManager rmgr,
String defaultClipBundle,
String defaultClipPath)
Constructs a sound manager with the default clip cache size.
|
JavaSoundPlayer(ResourceManager rmgr,
String defaultClipBundle,
String defaultClipPath,
int cacheSize)
Constructs a sound manager.
|
JavaSoundPlayer(SoundLoader loader,
int cacheSize) |
| Modifier and Type | Method and Description |
|---|---|
RunQueue |
getSoundQueue()
Gets the run queue on which sound should be played.
|
void |
lock(String pkgPath,
String... keys)
Optionally lock each of these keys prior to playing, to guarantee that it will be quickly
available for playing.
|
void |
setSoundQueue(RunQueue queue)
Sets the run queue on which sound should be played.
|
static AudioInputStream |
setupAudioStream(byte[] data)
Sets up an audio stream from the given byte array, and gets it to convert itself to PCM
data for writing to our output line (if it isn't already that)
|
static AudioInputStream |
setupAudioStream(InputStream in)
Sets up an audio stream from the given byte array, and gets it to convert itself to PCM
data for writing to our output line (if it isn't already that)
|
void |
shutdown()
Shut the damn thing off.
|
void |
unlock(String pkgPath,
String... keys)
Unlock the specified sounds so that its resources can be freed.
|
addSoundEnabledObserver, getClipVolume, isEnabled, loop, loop, play, play, play, play, removeSoundEnabledObserver, setClipVolume, setEnabled, shouldPlay, summarizeStatepublic static final int DEFAULT_CACHE_SIZE
public JavaSoundPlayer(ResourceManager rmgr)
public JavaSoundPlayer(ResourceManager rmgr, String defaultClipBundle, String defaultClipPath)
defaultClipPath - The pathname of a sound clip to use as a
fallback if another sound clip cannot be located.public JavaSoundPlayer(ResourceManager rmgr, String defaultClipBundle, String defaultClipPath, int cacheSize)
defaultClipPath - The pathname of a sound clip to use as a fallback if another sound
clip cannot be located.cacheSize - the number of bytes of sound clips to cache.public JavaSoundPlayer(SoundLoader loader, int cacheSize)
public void shutdown()
SoundPlayershutdown in class SoundPlayerpublic void setSoundQueue(RunQueue queue)
public RunQueue getSoundQueue()
SoundPlayerRunQueue.AWT.public void lock(String pkgPath, String... keys)
SoundPlayerlock in class SoundPlayerpublic void unlock(String pkgPath, String... keys)
SoundPlayerunlock in class SoundPlayerpublic static AudioInputStream setupAudioStream(byte[] data) throws UnsupportedAudioFileException, IOException
public static AudioInputStream setupAudioStream(InputStream in) throws UnsupportedAudioFileException, IOException
Copyright © 2015. All rights reserved.