soundPlayback
Class SoundCardFilePlayback

java.lang.Object
  extended by soundPlayback.SoundCardFilePlayback
All Implemented Interfaces:
FilePlaybackDevice

public class SoundCardFilePlayback
extends java.lang.Object
implements FilePlaybackDevice


Field Summary
private  javax.sound.sampled.AudioFormat audioFormat
           
private  FilePlayback filePlayback
           
private  byte[] rawAudio
           
private  java.lang.String[] soundCardNames
           
private  javax.sound.sampled.SourceDataLine sourceDataLine
           
(package private)  long startPlayback
           
 
Constructor Summary
SoundCardFilePlayback(FilePlayback filePlayback)
           
 
Method Summary
 java.lang.String[] getDeviceNames()
           
 java.lang.String getName()
           
 int getNumPlaybackChannels(int devNum)
          Get's the number of playback channels for a given device.
 boolean playData(RawDataUnit[] data)
          Play some data.
 boolean preparePlayback(PlaybackParameters playbackParameters)
          Prepare playback
 boolean stopPlayback()
          Stop playback, clean up buffers, etc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

SoundCardFilePlayback

public SoundCardFilePlayback(FilePlayback filePlayback)
Method Detail

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.