63 private long nativeStream;
64 private int inputFormat = -1;
65 private int outputFormat = -1;
81 private native
boolean readFloats(
float[] buffer,
int numFrames );
83 private native
boolean writeFloats(
float[] buffer,
int numFrames );
93 public boolean read(
float[] buffer,
int numFrames )
97 throw new RuntimeException(
98 "Tried to read float samples from a non float stream." );
100 return readFloats( buffer, numFrames );
112 public boolean write(
float[] buffer,
int numFrames )
116 throw new RuntimeException(
117 "Tried to write float samples to a non float stream." );
119 return writeFloats( buffer, numFrames );
122 private native
boolean readShorts(
short[] buffer,
int numFrames );
124 private native
boolean writeShorts(
short[] buffer,
int numFrames );
134 public boolean read(
short[] buffer,
int numFrames )
136 if( inputFormat !=
PortAudio.FORMAT_INT_16 )
138 throw new RuntimeException(
139 "Tried to read short samples from a non short stream." );
141 return readShorts( buffer, numFrames );
152 public boolean write(
short[] buffer,
int numFrames )
154 if( outputFormat !=
PortAudio.FORMAT_INT_16 )
156 throw new RuntimeException(
157 "Tried to write short samples from a non short stream." );
159 return writeShorts( buffer, numFrames );
184 public native
boolean isStopped();
186 public native
boolean isActive();
188 public String toString()
190 return "BlockingStream: streamPtr = " + Long.toHexString( nativeStream )
191 +
", inFormat = " + inputFormat +
", outFormat = "
200 private native
void getInfo(
StreamInfo streamInfo );
205 getInfo( streamInfo );
native int getWriteAvailable()
boolean read(short[] buffer, int numFrames)
boolean write(short[] buffer, int numFrames)
native int getReadAvailable()
boolean write(float[] buffer, int numFrames)
boolean read(float[] buffer, int numFrames)
static final int FORMAT_FLOAT_32