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, waitpublic 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.LineUnavailableExceptionpublic int available()
available in interface javax.sound.sampled.DataLinepublic void close()
close in interface java.lang.AutoCloseableclose in interface javax.sound.sampled.Linepublic void drain()
drain in interface javax.sound.sampled.DataLinepublic void flush()
flush in interface javax.sound.sampled.DataLinepublic int getFrameLength()
getFrameLength in interface javax.sound.sampled.Clippublic int getFramePosition()
getFramePosition in interface javax.sound.sampled.DataLinepublic long getLongFramePosition()
getLongFramePosition in interface javax.sound.sampled.DataLinepublic long getMicrosecondLength()
getMicrosecondLength in interface javax.sound.sampled.Clippublic long getMicrosecondPosition()
getMicrosecondPosition in interface javax.sound.sampled.DataLinepublic void loop(int count)
loop in interface javax.sound.sampled.Clippublic void open() throws javax.sound.sampled.LineUnavailableException
open in interface javax.sound.sampled.Linejavax.sound.sampled.LineUnavailableExceptionpublic void open(javax.sound.sampled.AudioFormat format, byte[] data, int offset, int bufferSize) throws javax.sound.sampled.LineUnavailableException
open in interface javax.sound.sampled.Clipjavax.sound.sampled.LineUnavailableExceptionpublic 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.Clipjavax.sound.sampled.LineUnavailableExceptionjava.io.IOExceptionpublic void setFramePosition(int frames)
setFramePosition in interface javax.sound.sampled.Clippublic void setLoopPoints(int start, int end)
setLoopPoints in interface javax.sound.sampled.Clippublic void setMicrosecondPosition(long microseconds)
setMicrosecondPosition in interface javax.sound.sampled.Clippublic void start()
start in interface javax.sound.sampled.DataLinepublic void stop()
stop in interface javax.sound.sampled.DataLinepublic javax.sound.sampled.Line.Info getLineInfo()
getLineInfo in interface javax.sound.sampled.Linepublic boolean isOpen()
true if line is openprotected void open(javax.sound.sampled.AudioFormat format, int bufferSize) throws javax.sound.sampled.LineUnavailableException
javax.sound.sampled.LineUnavailableExceptionprotected void open(javax.sound.sampled.AudioFormat format) throws javax.sound.sampled.LineUnavailableException
javax.sound.sampled.LineUnavailableExceptionpublic 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