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, waitpublic 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.SourceDataLinejavax.sound.sampled.LineUnavailableExceptionpublic void open(javax.sound.sampled.AudioFormat format) throws javax.sound.sampled.LineUnavailableException
open in interface javax.sound.sampled.SourceDataLinejavax.sound.sampled.LineUnavailableExceptionpublic 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.LineUnavailableExceptionpublic int write(byte[] data, int offset, int length)
write in interface javax.sound.sampled.SourceDataLinepublic int available()
available in interface javax.sound.sampled.DataLinepublic int getFramePosition()
getFramePosition in interface javax.sound.sampled.DataLinepublic long getLongFramePosition()
getLongFramePosition in interface javax.sound.sampled.DataLinepublic long getMicrosecondPosition()
getMicrosecondPosition in interface javax.sound.sampled.DataLinepublic void drain()
drain in interface javax.sound.sampled.DataLinepublic void flush()
flush in interface javax.sound.sampled.DataLinepublic void close()
close in interface java.lang.AutoCloseableclose in interface javax.sound.sampled.Linepublic javax.sound.sampled.Line.Info getLineInfo()
getLineInfo in interface javax.sound.sampled.Linepublic boolean isOpen()
true if line is openpublic void open() throws javax.sound.sampled.LineUnavailableException
open in interface javax.sound.sampled.Linejavax.sound.sampled.LineUnavailableExceptionpublic void start()
start in interface javax.sound.sampled.DataLinepublic void stop()
stop in interface javax.sound.sampled.DataLinepublic boolean isActive()
isActive in interface javax.sound.sampled.DataLinepublic boolean isRunning()
isRunning in interface javax.sound.sampled.DataLinepublic org.classpath.icedtea.pulseaudio.Stream getStream()
public int getBufferSize()
getBufferSize in interface javax.sound.sampled.DataLinepublic javax.sound.sampled.AudioFormat getFormat()
getFormat in interface javax.sound.sampled.DataLinepublic float getLevel()
getLevel in interface javax.sound.sampled.DataLinepublic 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.Lineprotected 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.Linepublic javax.sound.sampled.Control[] getControls()
getControls in interface javax.sound.sampled.Linepublic boolean isControlSupported(javax.sound.sampled.Control.Type control)
isControlSupported in interface javax.sound.sampled.Linepublic boolean isOpen()
isOpen in interface javax.sound.sampled.Linepublic void removeLineListener(javax.sound.sampled.LineListener listener)
removeLineListener in interface javax.sound.sampled.Line