public class RMIRemoteAudio extends java.rmi.server.UnicastRemoteObject implements RMIAudio
| Modifier | Constructor and Description |
|---|---|
protected |
RMIRemoteAudio() |
| Modifier and Type | Method and Description |
|---|---|
int |
getVolume()
Get the current master volume level
|
void |
loadSettings()
Load the current system settings associated with this class.
|
void |
playNote(int[] inst,
int freq,
int len)
Play a note with attack, decay, sustain and release shape.
|
int |
playSample(byte[] data,
int offset,
int len,
int freq,
int vol)
Queue a series of PCM samples to play at the
specified volume and sample rate.
|
int |
playSample(java.io.File file)
Play a wav file
|
int |
playSample(java.io.File file,
int vol)
Play a wav file
|
void |
playTone(int freq,
int duration) |
void |
playTone(int aFrequency,
int aDuration,
int aVolume)
Plays a tone, given its frequency and duration.
|
void |
setVolume(int vol)
Set the master volume level
|
void |
systemSound(int aCode)
Play a system sound.
|
clone, exportObject, exportObject, exportObject, unexportObjectprotected RMIRemoteAudio()
throws java.rmi.RemoteException
java.rmi.RemoteExceptionpublic void systemSound(int aCode)
throws java.rmi.RemoteException
RMIAudio| aCode | Resulting Sound |
|---|---|
| 0 | short beep |
| 1 | double beep |
| 2 | descending arpeggio |
| 3 | ascending arpeggio |
| 4 | long, low buzz |
systemSound in interface RMIAudiojava.rmi.RemoteExceptionpublic void playTone(int aFrequency,
int aDuration,
int aVolume)
throws java.rmi.RemoteException
RMIAudiopublic void playTone(int freq,
int duration)
throws java.rmi.RemoteException
public int playSample(java.io.File file,
int vol)
throws java.rmi.RemoteException
RMIAudioplaySample in interface RMIAudiofile - the 8-bit PWM (WAV) sample filevol - the volume percentage 0 - 100java.rmi.RemoteExceptionpublic int playSample(java.io.File file)
throws java.rmi.RemoteException
RMIAudioplaySample in interface RMIAudiofile - the 8-bit PWM (WAV) sample filejava.rmi.RemoteExceptionpublic int playSample(byte[] data,
int offset,
int len,
int freq,
int vol)
throws java.rmi.RemoteException
RMIAudioplaySample in interface RMIAudiodata - Buffer containing the samplesoffset - Offset of the first sample in the bufferlen - Number of samples to queuefreq - Sample ratevol - playback volumejava.rmi.RemoteExceptionpublic void playNote(int[] inst,
int freq,
int len)
throws java.rmi.RemoteException
RMIAudiopublic void setVolume(int vol)
throws java.rmi.RemoteException
RMIAudiopublic int getVolume()
throws java.rmi.RemoteException
RMIAudiopublic void loadSettings()
throws java.rmi.RemoteException
RMIAudioloadSettings in interface RMIAudiojava.rmi.RemoteException