public final class PulseAudioSourceDataLine extends java.lang.Object implements javax.sound.sampled.SourceDataLine
Modifier and Type | Field and Description |
---|---|
protected java.util.List<javax.sound.sampled.Control> |
controls |
protected javax.sound.sampled.AudioFormat |
currentFormat |
protected boolean |
dataWritten |
protected static int |
DEFAULT_BUFFER_SIZE |
static java.lang.String |
DEFAULT_SOURCEDATALINE_NAME |
protected javax.sound.sampled.AudioFormat |
defaultFormat |
protected org.classpath.icedtea.pulseaudio.EventLoop |
eventLoop |
protected long |
framesSinceOpen |
protected boolean |
isOpen |
protected boolean |
isStarted |
protected java.util.List<javax.sound.sampled.LineListener> |
lineListeners |
static int |
SECONDS_TO_MICROSECONDS |
protected java.util.concurrent.Semaphore |
semaphore |
protected boolean |
sendEvents |
protected org.classpath.icedtea.pulseaudio.Stream |
stream |
protected java.lang.String |
streamName |
protected javax.sound.sampled.AudioFormat[] |
supportedFormats |
Modifier and Type | Method and Description |
---|---|
void |
addLineListener(javax.sound.sampled.LineListener listener) |
int |
available() |
void |
close() |
protected void |
connectLine(int bufferSize,
org.classpath.icedtea.pulseaudio.Stream masterStream) |
void |
drain() |
protected void |
fireLineEvent(javax.sound.sampled.LineEvent e) |
void |
flush() |
int |
getBufferSize() |
int |
getBytesInBuffer() |
float |
getCachedVolume()
Gets the cached volume.
|
javax.sound.sampled.Control |
getControl(javax.sound.sampled.Control.Type control) |
javax.sound.sampled.Control[] |
getControls() |
javax.sound.sampled.AudioFormat |
getFormat() |
int |
getFramePosition() |
float |
getLevel() |
javax.sound.sampled.Line.Info |
getLineInfo() |
long |
getLongFramePosition() |
long |
getMicrosecondPosition() |
java.lang.String |
getName() |
org.classpath.icedtea.pulseaudio.Stream |
getStream() |
boolean |
isActive() |
boolean |
isControlSupported(javax.sound.sampled.Control.Type control) |
boolean |
isOpen()
Check if a line is open
|
boolean |
isOpen() |
boolean |
isRunning() |
byte[] |
native_set_volume(float value)
Set the volume of the Line (ie, sink input, source, or sink)
|
byte[] |
native_update_volume()
Update the volume information of a Line (sink input, source or sink)
|
void |
open() |
void |
open(javax.sound.sampled.AudioFormat format) |
void |
open(javax.sound.sampled.AudioFormat format,
int bufferSize) |
void |
removeLineListener(javax.sound.sampled.LineListener listener) |
void |
setCachedVolume(float value)
Set the cached value of a line
|
void |
setName(java.lang.String streamName) |
void |
start() |
void |
stop() |
int |
write(byte[] data,
int offset,
int length) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final java.lang.String DEFAULT_SOURCEDATALINE_NAME
public static final int SECONDS_TO_MICROSECONDS
protected static final int DEFAULT_BUFFER_SIZE
protected java.lang.String streamName
protected boolean isStarted
protected boolean dataWritten
protected javax.sound.sampled.AudioFormat[] supportedFormats
protected javax.sound.sampled.AudioFormat currentFormat
protected javax.sound.sampled.AudioFormat defaultFormat
protected boolean sendEvents
protected long framesSinceOpen
protected org.classpath.icedtea.pulseaudio.EventLoop eventLoop
protected java.util.concurrent.Semaphore semaphore
protected org.classpath.icedtea.pulseaudio.Stream stream
protected java.util.List<javax.sound.sampled.LineListener> lineListeners
protected java.util.List<javax.sound.sampled.Control> controls
protected boolean isOpen
public void open(javax.sound.sampled.AudioFormat format, int bufferSize) throws javax.sound.sampled.LineUnavailableException
open
in interface javax.sound.sampled.SourceDataLine
javax.sound.sampled.LineUnavailableException
public void open(javax.sound.sampled.AudioFormat format) throws javax.sound.sampled.LineUnavailableException
open
in interface javax.sound.sampled.SourceDataLine
javax.sound.sampled.LineUnavailableException
public byte[] native_set_volume(float value)
public byte[] native_update_volume()
public float getCachedVolume()
public void setCachedVolume(float value)
protected void connectLine(int bufferSize, org.classpath.icedtea.pulseaudio.Stream masterStream) throws javax.sound.sampled.LineUnavailableException
javax.sound.sampled.LineUnavailableException
public int write(byte[] data, int offset, int length)
write
in interface javax.sound.sampled.SourceDataLine
public int available()
available
in interface javax.sound.sampled.DataLine
public int getFramePosition()
getFramePosition
in interface javax.sound.sampled.DataLine
public long getLongFramePosition()
getLongFramePosition
in interface javax.sound.sampled.DataLine
public long getMicrosecondPosition()
getMicrosecondPosition
in interface javax.sound.sampled.DataLine
public void drain()
drain
in interface javax.sound.sampled.DataLine
public void flush()
flush
in interface javax.sound.sampled.DataLine
public void close()
close
in interface java.lang.AutoCloseable
close
in interface javax.sound.sampled.Line
public javax.sound.sampled.Line.Info getLineInfo()
getLineInfo
in interface javax.sound.sampled.Line
public boolean isOpen()
true
if line is openpublic void open() throws javax.sound.sampled.LineUnavailableException
open
in interface javax.sound.sampled.Line
javax.sound.sampled.LineUnavailableException
public void start()
start
in interface javax.sound.sampled.DataLine
public void stop()
stop
in interface javax.sound.sampled.DataLine
public boolean isActive()
isActive
in interface javax.sound.sampled.DataLine
public boolean isRunning()
isRunning
in interface javax.sound.sampled.DataLine
public org.classpath.icedtea.pulseaudio.Stream getStream()
public int getBufferSize()
getBufferSize
in interface javax.sound.sampled.DataLine
public javax.sound.sampled.AudioFormat getFormat()
getFormat
in interface javax.sound.sampled.DataLine
public float getLevel()
getLevel
in interface javax.sound.sampled.DataLine
public void setName(java.lang.String streamName)
streamName
- the name of this audio streampublic java.lang.String getName()
public int getBytesInBuffer()
public void addLineListener(javax.sound.sampled.LineListener listener)
addLineListener
in interface javax.sound.sampled.Line
protected void fireLineEvent(javax.sound.sampled.LineEvent e)
public javax.sound.sampled.Control getControl(javax.sound.sampled.Control.Type control)
getControl
in interface javax.sound.sampled.Line
public javax.sound.sampled.Control[] getControls()
getControls
in interface javax.sound.sampled.Line
public boolean isControlSupported(javax.sound.sampled.Control.Type control)
isControlSupported
in interface javax.sound.sampled.Line
public boolean isOpen()
isOpen
in interface javax.sound.sampled.Line
public void removeLineListener(javax.sound.sampled.LineListener listener)
removeLineListener
in interface javax.sound.sampled.Line