|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread jass.render.RTAudioIn
public class RTAudioIn
Utility class to read audio in real-time. Use appropriate constructor to use JavaSound or native sound support
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
RTAudioIn(float srate,
int nchannels,
int bufferSizeJass)
Constructor. |
|
RTAudioIn(float srate,
int bitsPerFrame,
int nchannels,
boolean signed)
Constructor. |
|
RTAudioIn(float srate,
int nchannels,
int bufferSizeJass,
int numRtAudioBuffers)
Constructor. |
|
RTAudioIn(int buffersize,
float srate,
int bitsPerFrame,
int nchannels,
boolean signed)
Constructor. |
|
RTAudioIn(int buffersize,
float srate,
int bitsPerFrame,
int nchannels,
boolean signed,
java.lang.String prefMixer)
Constructor. |
Method Summary | |
---|---|
void |
close()
|
void |
closeNativeSound(long nativeObjectPointer)
Close native sound This is a native method and needs librtaudio.so (LINUX) or rtaudio.dll (Windows) |
long |
initNativeSound(int nchannels,
int srate,
int bufferSizeJass,
int numRtAudioBuffers)
Initialize native sound for RtAudio This is a native method and needs librtaudio.so (LINUX) or rtaudio.dll (Windows) |
void |
read(float[] y,
int nsamples)
Read audio buffer from input queue and block if queue is empty. |
void |
readNativeSoundFloat(long nativeObjectPointer,
float[] buf,
int buflen)
Read a buffer of floats using native sound. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RTAudioIn(int buffersize, float srate, int bitsPerFrame, int nchannels, boolean signed)
bufferSize
- Buffer size used by JavaSound.srate
- sampling rate in Hertz.bitsPerFrame
- number of bits per audio frame.nchannels
- number of audio channels.signed
- true if signed format, false otherwise.public RTAudioIn(int buffersize, float srate, int bitsPerFrame, int nchannels, boolean signed, java.lang.String prefMixer)
bufferSize
- Buffer size used by JavaSound.srate
- sampling rate in Hertz.bitsPerFrame
- number of bits per audio frame.nchannels
- number of audio channels.signed
- true if signed format, false otherwise.prefMixer
- preferred mixer as name stringpublic RTAudioIn(float srate, int bitsPerFrame, int nchannels, boolean signed)
srate
- sampling rate in Hertz.bitsPerFrame
- number of bits per audio frame.nchannels
- number of audio channels.signed
- true if signed format, false otherwise.public RTAudioIn(float srate, int nchannels, int bufferSizeJass, int numRtAudioBuffers)
srate
- sampling rate in Hertz.nchannels
- number of audio channels.bufferSizeJass
- jass bufsznumRtAudioBuffers
- rtaudio parameter related to latency. 0 lowestpublic RTAudioIn(float srate, int nchannels, int bufferSizeJass)
srate
- sampling rate in Hertz.nchannels
- number of audio channels.bufferSizeJass
- jass bufszMethod Detail |
---|
public long initNativeSound(int nchannels, int srate, int bufferSizeJass, int numRtAudioBuffers)
nchannels
- number of audio channels.srate
- sampling rate in Hertz.bufferSizeJass
- jass buffersizenumRtAudioBuffers
- affectiing latency, 0 gives best latency
public void readNativeSoundFloat(long nativeObjectPointer, float[] buf, int buflen)
nativeObjectPointer
- representing C++ object pointer.buf
- array of float with sound buffer.buflen
- length of buffer.public void closeNativeSound(long nativeObjectPointer)
nativeObjectPointer
- representing C++ object pointerpublic void read(float[] y, int nsamples)
y
- buffer to write to.nsamples
- number of samples required.public void close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |