javazoom.jl.player

Class JavaSoundAudioDevice

Implemented Interfaces:
AudioDevice

public class JavaSoundAudioDevice
extends AudioDeviceBase

The JavaSoundAudioDevice implements an audio device by using the JavaSound API.
Since:
0.0.8

Method Summary

protected void
closeImpl()
Template method to provide the implementation for closing the audio device.
protected void
createSource()
protected void
flushImpl()
Template method to provide the implementation for flushing any buffered audio data.
protected AudioFormat
getAudioFormat()
protected byte[]
getByteArray(int length)
int
getPosition()
protected DataLine.Info
getSourceLineInfo()
int
millisecondsToBytes(AudioFormat fmt, int time)
void
open(AudioFormat fmt)
protected void
openImpl()
Template method to provide the implementation for the opening of the audio device.
protected void
setAudioFormat(AudioFormat fmt0)
void
test()
Runs a short test by playing a short silent sound.
protected byte[]
toByteArray(short[] samples, int offs, int len)
protected void
writeImpl(short[] samples, int offs, int len)
Template method to provide the implementation for writing audio samples to the audio device.

Methods inherited from class javazoom.jl.player.AudioDeviceBase

close, closeImpl, flush, flushImpl, getDecoder, isOpen, open, openImpl, setOpen, write, writeImpl

Method Details

closeImpl

protected void closeImpl()
Template method to provide the implementation for closing the audio device.
Overrides:
closeImpl in interface AudioDeviceBase

createSource

protected void createSource()
            throws JavaLayerException

flushImpl

protected void flushImpl()
Template method to provide the implementation for flushing any buffered audio data.
Overrides:
flushImpl in interface AudioDeviceBase

getAudioFormat

protected AudioFormat getAudioFormat()

getByteArray

protected byte[] getByteArray(int length)

getPosition

public int getPosition()
Specified by:
getPosition in interface AudioDevice

getSourceLineInfo

protected DataLine.Info getSourceLineInfo()

millisecondsToBytes

public int millisecondsToBytes(AudioFormat fmt,
                               int time)

open

public void open(AudioFormat fmt)
            throws JavaLayerException

openImpl

protected void openImpl()
            throws JavaLayerException
Template method to provide the implementation for the opening of the audio device.
Overrides:
openImpl in interface AudioDeviceBase

setAudioFormat

protected void setAudioFormat(AudioFormat fmt0)

test

public void test()
            throws JavaLayerException
Runs a short test by playing a short silent sound.

toByteArray

protected byte[] toByteArray(short[] samples,
                             int offs,
                             int len)

writeImpl

protected void writeImpl(short[] samples,
                         int offs,
                         int len)
            throws JavaLayerException
Template method to provide the implementation for writing audio samples to the audio device.
Overrides:
writeImpl in interface AudioDeviceBase

JavaZOOM 1999-2005