soundPlayback
Class SoundCardFilePlayback
java.lang.Object
soundPlayback.SoundCardFilePlayback
- All Implemented Interfaces:
- FilePlaybackDevice
public class SoundCardFilePlayback
- extends java.lang.Object
- implements FilePlaybackDevice
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
filePlayback
private FilePlayback filePlayback
soundCardNames
private java.lang.String[] soundCardNames
audioFormat
private javax.sound.sampled.AudioFormat audioFormat
sourceDataLine
private javax.sound.sampled.SourceDataLine sourceDataLine
rawAudio
private byte[] rawAudio
startPlayback
long startPlayback
SoundCardFilePlayback
public SoundCardFilePlayback(FilePlayback filePlayback)
getName
public java.lang.String getName()
- Specified by:
getName in interface FilePlaybackDevice
- Returns:
- a name for this type of playback device
getDeviceNames
public java.lang.String[] getDeviceNames()
- Specified by:
getDeviceNames in interface FilePlaybackDevice
- Returns:
- a list of device names
getNumPlaybackChannels
public int getNumPlaybackChannels(int devNum)
- Description copied from interface:
FilePlaybackDevice
- Get's the number of playback channels for a given device.
- Specified by:
getNumPlaybackChannels in interface FilePlaybackDevice
- Parameters:
devNum - device number
- Returns:
- number of channels
playData
public boolean playData(RawDataUnit[] data)
- Description copied from interface:
FilePlaybackDevice
- Play some data. The length of the data array must
correspond to the number of channels.
- Specified by:
playData in interface FilePlaybackDevice
- Parameters:
data - array of raw audio data units.
- Returns:
- true if played OK.
preparePlayback
public boolean preparePlayback(PlaybackParameters playbackParameters)
- Description copied from interface:
FilePlaybackDevice
- Prepare playback
- Specified by:
preparePlayback in interface FilePlaybackDevice
- Parameters:
playbackParameters - parameters
- Returns:
- true if all Ok. S
stopPlayback
public boolean stopPlayback()
- Description copied from interface:
FilePlaybackDevice
- Stop playback, clean up buffers, etc.
- Specified by:
stopPlayback in interface FilePlaybackDevice
- Returns:
- true if all cleaned up Ok.