public class JavaSound extends Object implements AudioDriver
| Constructor and Description |
|---|
JavaSound() |
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
buffer()
Return the bytebuffer intended to hold the audio data.
|
void |
close()
Free the audio device.
|
void |
flush() |
static List<Mixer.Info> |
getDevices() |
int |
getRemainingPlayTime()
Estimate the length of audio data before we run out
|
void |
open(AudioConfig cfg,
Mixer.Info info) |
void |
open(AudioConfig cfg,
String recordingFilename,
CPUClock cpuClock)
Open audio interface.
|
void |
pause()
Temporarily cease audio production, for instance if user paused the
application.
|
void |
setAudioDevice(Mixer.Info info) |
void |
write()
Write the complete contents of ByteBuffer to audio device.
|
public void open(AudioConfig cfg, String recordingFilename, CPUClock cpuClock) throws IOException, LineUnavailableException
AudioDriveropen in interface AudioDrivercfg - Configuration requested.recordingFilename - name for a recordingIOExceptionLineUnavailableExceptionpublic static final List<Mixer.Info> getDevices()
public void open(AudioConfig cfg, Mixer.Info info) throws IOException, LineUnavailableException
IOExceptionLineUnavailableExceptionpublic void setAudioDevice(Mixer.Info info) throws LineUnavailableException
LineUnavailableExceptionpublic void write()
throws InterruptedException
AudioDriverwrite in interface AudioDriverInterruptedExceptionpublic int getRemainingPlayTime()
public void pause()
AudioDriverpause in interface AudioDriverpublic void flush()
public void close()
AudioDriverclose in interface AudioDriverpublic ByteBuffer buffer()
AudioDriverbuffer in interface AudioDriverCopyright © 2018 Ken Händel. All rights reserved.