public class TinySound extends Object
Modifier and Type | Field and Description |
---|---|
static AudioFormat |
FORMAT
The internal format used by TinySound.
|
static String |
VERSION |
Constructor and Description |
---|
TinySound() |
Modifier and Type | Method and Description |
---|---|
static double |
getGlobalVolume()
Get the global volume for all audio.
|
static void |
init()
Initialize Tinysound.
|
static void |
init(Mixer.Info info)
Alternative function to initialize TinySound which should only be used by
those very familiar with the Java Sound API.
|
static boolean |
isInitialized()
Determine if TinySound is initialized and ready for use.
|
static Music |
loadMusic(File file)
Load a Music by a File.
|
static Music |
loadMusic(File file,
boolean streamFromFile)
Load a Music by a File.
|
static Music |
loadMusic(String name)
Load a Music by a resource name.
|
static Music |
loadMusic(String name,
boolean streamFromFile)
Load a Music by a resource name.
|
static Music |
loadMusic(URL url)
Load a Music by a URL.
|
static Music |
loadMusic(URL url,
boolean streamFromFile)
Load a Music by a URL.
|
static Sound |
loadSound(File file)
Load a Sound by a File.
|
static Sound |
loadSound(File file,
boolean streamFromFile)
Load a Sound by a File.
|
static Sound |
loadSound(String name)
Load a Sound by a resource name.
|
static Sound |
loadSound(String name,
boolean streamFromFile)
Load a Sound by a resource name.
|
static Sound |
loadSound(URL url)
Load a Sound by a URL.
|
static Sound |
loadSound(URL url,
boolean streamFromFile)
Load a Sound by a URL.
|
static void |
setGlobalVolume(double volume)
Set the global volume.
|
static void |
shutdown()
Shutdown TinySound.
|
public static final String VERSION
public static final AudioFormat FORMAT
public static void init()
public static void init(Mixer.Info info) throws LineUnavailableException, SecurityException, IllegalArgumentException
info
- the Mixer.Info representing the desired MixerLineUnavailableException
- if a Line is not available from the
specified MixerSecurityException
- if the specified Mixer or Line are unavailable
due to security restrictionsIllegalArgumentException
- if the specified Mixer is not installed
on the systempublic static void shutdown()
public static boolean isInitialized()
public static double getGlobalVolume()
public static void setGlobalVolume(double volume)
volume
- the global volume to setpublic static Music loadMusic(String name)
name
- name of the Music resourcepublic static Music loadMusic(String name, boolean streamFromFile)
name
- name of the Music resourcestreamFromFile
- true if this Music should be streamed from a
temporary file to reduce memory overheadpublic static Music loadMusic(File file)
file
- the Music file to loadpublic static Music loadMusic(File file, boolean streamFromFile)
file
- the Music file to loadstreamFromFile
- true if this Music should be streamed from a
temporary file to reduce memory overheadpublic static Music loadMusic(URL url)
url
- the URL of the Musicpublic static Music loadMusic(URL url, boolean streamFromFile)
url
- the URL of the MusicstreamFromFile
- true if this Music should be streamed from a
temporary file to reduce memory overheadpublic static Sound loadSound(String name)
name
- name of the Sound resourcepublic static Sound loadSound(String name, boolean streamFromFile)
name
- name of the Sound resourcestreamFromFile
- true if this Music should be streamed from a
temporary file to reduce memory overheadpublic static Sound loadSound(File file)
file
- the Sound file to loadpublic static Sound loadSound(File file, boolean streamFromFile)
file
- the Sound file to loadstreamFromFile
- true if this Music should be streamed from a
temporary file to reduce memory overheadpublic static Sound loadSound(URL url)
url
- the URL of the Soundpublic static Sound loadSound(URL url, boolean streamFromFile)
url
- the URL of the SoundstreamFromFile
- true if this Music should be streamed from a
temporary file to reduce memory overhead