public final class PulseAudioClip extends java.lang.Object implements javax.sound.sampled.Clip
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_CLIP_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 |
getFrameLength() |
int |
getFramePosition() |
float |
getLevel() |
javax.sound.sampled.Line.Info |
getLineInfo() |
long |
getLongFramePosition() |
long |
getMicrosecondLength() |
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() |
void |
loop(int count) |
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() |
protected void |
open(javax.sound.sampled.AudioFormat format) |
void |
open(javax.sound.sampled.AudioFormat format,
byte[] data,
int offset,
int bufferSize) |
protected void |
open(javax.sound.sampled.AudioFormat format,
int bufferSize) |
void |
open(javax.sound.sampled.AudioInputStream stream) |
void |
removeLineListener(javax.sound.sampled.LineListener listener) |
void |
setCachedVolume(float value)
Set the cached value of a line
|
void |
setFramePosition(int frames) |
void |
setLoopPoints(int start,
int end) |
void |
setMicrosecondPosition(long microseconds) |
void |
setName(java.lang.String streamName) |
void |
start() |
void |
stop() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final java.lang.String DEFAULT_CLIP_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
protected void connectLine(int bufferSize, org.classpath.icedtea.pulseaudio.Stream masterStream) throws javax.sound.sampled.LineUnavailableException
javax.sound.sampled.LineUnavailableException
public int available()
available
in interface javax.sound.sampled.DataLine
public void close()
close
in interface java.lang.AutoCloseable
close
in interface javax.sound.sampled.Line
public void drain()
drain
in interface javax.sound.sampled.DataLine
public void flush()
flush
in interface javax.sound.sampled.DataLine
public int getFrameLength()
getFrameLength
in interface javax.sound.sampled.Clip
public int getFramePosition()
getFramePosition
in interface javax.sound.sampled.DataLine
public long getLongFramePosition()
getLongFramePosition
in interface javax.sound.sampled.DataLine
public long getMicrosecondLength()
getMicrosecondLength
in interface javax.sound.sampled.Clip
public long getMicrosecondPosition()
getMicrosecondPosition
in interface javax.sound.sampled.DataLine
public void loop(int count)
loop
in interface javax.sound.sampled.Clip
public void open() throws javax.sound.sampled.LineUnavailableException
open
in interface javax.sound.sampled.Line
javax.sound.sampled.LineUnavailableException
public void open(javax.sound.sampled.AudioFormat format, byte[] data, int offset, int bufferSize) throws javax.sound.sampled.LineUnavailableException
open
in interface javax.sound.sampled.Clip
javax.sound.sampled.LineUnavailableException
public byte[] native_set_volume(float value)
public byte[] native_update_volume()
public float getCachedVolume()
public void setCachedVolume(float value)
public void open(javax.sound.sampled.AudioInputStream stream) throws javax.sound.sampled.LineUnavailableException, java.io.IOException
open
in interface javax.sound.sampled.Clip
javax.sound.sampled.LineUnavailableException
java.io.IOException
public void setFramePosition(int frames)
setFramePosition
in interface javax.sound.sampled.Clip
public void setLoopPoints(int start, int end)
setLoopPoints
in interface javax.sound.sampled.Clip
public void setMicrosecondPosition(long microseconds)
setMicrosecondPosition
in interface javax.sound.sampled.Clip
public void start()
start
in interface javax.sound.sampled.DataLine
public void stop()
stop
in interface javax.sound.sampled.DataLine
public javax.sound.sampled.Line.Info getLineInfo()
getLineInfo
in interface javax.sound.sampled.Line
public boolean isOpen()
true
if line is openprotected void open(javax.sound.sampled.AudioFormat format, int bufferSize) throws javax.sound.sampled.LineUnavailableException
javax.sound.sampled.LineUnavailableException
protected void open(javax.sound.sampled.AudioFormat format) throws javax.sound.sampled.LineUnavailableException
javax.sound.sampled.LineUnavailableException
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