|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
jass.render.RTAudioFullDuplexRtAudio
public class RTAudioFullDuplexRtAudio
Utility class to read/write audio in real-time using native libs from RtAudio C++ classes
| 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 | |
|---|---|
RTAudioFullDuplexRtAudio(float srate,
int nchannels,
int buffersizeJASS,
int numRtAudioBuffers)
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) or whatever its called on MAC OSX |
long |
initNativeSound(int nchannels,
int srate,
int buffersizeJASS,
int nRtaudioBuffers)
Initialize native sound using RtAudio, setting buffersize and an internal RtAudio buffersize |
void |
read(float[] y,
int nsamples)
Read audio buffer from input queue and block if queue is empty. |
void |
write(float[] y)
Write audio buffer to output queue and block if queue is full. |
void |
writeReadNativeSoundFloat(long nativeObjectPointer,
float[] outbuf,
int outbuflen,
float[] readbuf,
int readbuflen)
write/read a buffer of floats to 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 RTAudioFullDuplexRtAudio(float srate,
int nchannels,
int buffersizeJASS,
int numRtAudioBuffers)
srate - sampling rate in Hertz.nchannels - number of audio channels.buffersizeJass - jass buffersizenumRtAudioBuffers - number of rtaudio buffers (0 is lowest)| Method Detail |
|---|
public long initNativeSound(int nchannels,
int srate,
int buffersizeJASS,
int nRtaudioBuffers)
nchannels - number of audio channels.srate - sampling rate in Hertz.buffersizeJASS - buffers will be rendered in these chunksnRtaudioBuffers - internal buffers, 0 = lowest possiblse
public void closeNativeSound(long nativeObjectPointer)
nativeObjectPointer - representing C++ object pointer
public void writeReadNativeSoundFloat(long nativeObjectPointer,
float[] outbuf,
int outbuflen,
float[] readbuf,
int readbuflen)
nativeObjectPointer - representing C++ object pointer.outbuf - array of floats with sound buffer to be output to audio cardoutbuflen - length of buffer.readbuf - array of floats with sound buffer to be read from audio inputreadbuflen - length of read buffer.
public void read(float[] y,
int nsamples)
y - buffer to write to.nsamples - number of samples required.public void write(float[] y)
y - output buffer.public void close()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||