Methods Summary |
---|
public synchronized void | close()
if (dsBuffer != 0)
nClose(dsBuffer);
dsBuffer = 0;
|
public void | flush()
nFlush(dsBuffer);
|
public int | getBufferSize()
return bufSize;
|
public javax.media.format.AudioFormat | getFormat()
return format;
|
public static boolean | isFormatSupported(javax.media.format.AudioFormat format, int bufSize)
return true;
|
public static boolean | isOpen()
return opened;
|
private native synchronized void | nClose(long dsBuffer)
|
private native synchronized void | nFlush(long dsBuffer)
|
private native long | nOpen(int sampleRate, int sampleSize, int channels, int bufferSize)
|
private native synchronized int | nRead(long dsBuffer, byte[] data, int offset, int len)
|
private native synchronized void | nStart(long dsBuffer)
|
private native synchronized void | nStop(long dsBuffer)
|
public void | open()
dsBuffer = nOpen((int) format.getSampleRate(),
format.getSampleSizeInBits(),
format.getChannels(),
bufSize);
if (dsBuffer == 0)
throw new Error("Couldn't create capture buffer");
|
public int | read(byte[] data, int offset, int len)
return nRead(dsBuffer, data, offset, len);
|
public void | start()
nStart(dsBuffer);
|
public void | stop()
nStop(dsBuffer);
|