public class Mixer extends Object
Constructor and Description |
---|
Mixer()
Construct a new Mixer for TinySound system.
|
Modifier and Type | Method and Description |
---|---|
void |
clearMusic()
Unregister all Music registered with this Mixer.
|
void |
clearSounds()
Unregister all Sounds registered with this Mixer.
|
double |
getVolume()
Get the global volume for this Mixer.
|
int |
read(byte[] data,
int offset,
int length)
Read bytes from this Mixer.
|
void |
registerMusicReference(MusicReference music)
Registers a MusicReference with this Mixer.
|
void |
registerSoundReference(SoundReference sound)
Registers a SoundReference with this Mixer.
|
void |
setVolume(double volume)
Set the global volume for this Mixer.
|
void |
skip(int numBytes)
Skip specified number of bytes of all audio in this Mixer.
|
void |
unRegisterMusicReference(MusicReference music)
Unregisters a MusicReference with this Mixer.
|
void |
unRegisterSoundReference(int soundID)
Unregisters all SoundReferences with a given soundID.
|
public double getVolume()
public void setVolume(double volume)
volume
- the global volume to setpublic void registerMusicReference(MusicReference music)
music
- MusicReference to be registeredpublic void registerSoundReference(SoundReference sound)
sound
- SoundReference to be registeredpublic void unRegisterMusicReference(MusicReference music)
music
- MusicReference to be unregisteredpublic void unRegisterSoundReference(int soundID)
soundID
- ID of SoundReferences to be unregisteredpublic void clearMusic()
public void clearSounds()
public int read(byte[] data, int offset, int length)
data
- the buffer to read the bytes intooffset
- the start index to read bytes intolength
- the maximum number of bytes that should be readpublic void skip(int numBytes)
numBytes
- the number of bytes to skip