org.tritonus.sampled.mixer.alsa
Class AlsaSourceDataLine

java.lang.Object
  extended by org.tritonus.share.sampled.mixer.TLine
      extended by org.tritonus.share.sampled.mixer.TDataLine
          extended by org.tritonus.share.sampled.mixer.TBaseDataLine
              extended by org.tritonus.sampled.mixer.alsa.AlsaBaseDataLine
                  extended by org.tritonus.sampled.mixer.alsa.AlsaSourceDataLine
All Implemented Interfaces:
DataLine, Line, SourceDataLine

public class AlsaSourceDataLine
extends AlsaBaseDataLine
implements SourceDataLine


Nested Class Summary
 class AlsaSourceDataLine.AlsaSourceDataLineGainControl
           
 
Nested classes/interfaces inherited from class org.tritonus.sampled.mixer.alsa.AlsaBaseDataLine
AlsaBaseDataLine.AlsaBaseDataLineGainControl
 
Nested classes/interfaces inherited from interface javax.sound.sampled.DataLine
DataLine.Info
 
Constructor Summary
AlsaSourceDataLine(AlsaDataLineMixer mixer, AudioFormat format, int nBufferSize)
           
 
Method Summary
 int available()
           
 void drain()
           
 void flush()
           
 int write(byte[] abData, int nOffset, int nLength)
          Write data to the line.
 
Methods inherited from class org.tritonus.share.sampled.mixer.TBaseDataLine
open, open
 
Methods inherited from class org.tritonus.share.sampled.mixer.TDataLine
getBufferSize, getFormat, getFramePosition, getLevel, getLongFramePosition, getMicrosecondPosition, isActive, isRunning, start, stop
 
Methods inherited from class org.tritonus.share.sampled.mixer.TLine
addLineListener, close, getControl, getControls, getLineInfo, isControlSupported, isOpen, open, removeLineListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.sound.sampled.SourceDataLine
open, open
 
Methods inherited from interface javax.sound.sampled.DataLine
getBufferSize, getFormat, getFramePosition, getLevel, getMicrosecondPosition, isActive, isRunning, start, stop
 
Methods inherited from interface javax.sound.sampled.Line
addLineListener, close, getControl, getControls, getLineInfo, isControlSupported, isOpen, open, removeLineListener
 

Constructor Detail

AlsaSourceDataLine

public AlsaSourceDataLine(AlsaDataLineMixer mixer,
                          AudioFormat format,
                          int nBufferSize)
                   throws LineUnavailableException
Throws:
LineUnavailableException
Method Detail

available

public int available()
Specified by:
available in interface DataLine
Overrides:
available in class AlsaBaseDataLine

write

public int write(byte[] abData,
                 int nOffset,
                 int nLength)
Description copied from interface: SourceDataLine
Write data to the line.

Specified by:
write in interface SourceDataLine
Parameters:
abData - The buffer to use.
nLength - The length of the data that should be written, in bytes. Can be less that the length of abData.
Returns:
The number of bytes written. May be less than nLength.

drain

public void drain()
Specified by:
drain in interface DataLine
Overrides:
drain in class AlsaBaseDataLine

flush

public void flush()
Specified by:
flush in interface DataLine
Overrides:
flush in class AlsaBaseDataLine