Warning: session_start(): open(/var/lib/php/sessions/sess_o1087790baf32hgvnjt2oteq33, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
sinterface Capturer {
void stop();
byte[] getPCM();
}
static Capturer captureAudioFromLine2(DataLine line, AudioFormat format) ctex {
if (!line instanceof TargetDataLine)
fail(getClassName(line));
final TargetDataLine tdl = cast line;
tdl.open(format);
tdl.start();
ret new Capturer {
volatile bool stopped;
new ByteArrayOutputStream baos;
void stop() { stopped = true; }
*() {
thread "Audio Capture" {
try {
int total = 0, n;
byte[] buf = new byte[1024];
while (!stopped && (n = tdl.read(buf, 0, min(l(buf), bytesWanted-total))) > 0) {
total += n;
baos.write(buf, 0, n);
print("Bytes read from line: " + total);
}
} finally {
tdl.close();
}
}
}
byte[] getPCM() {
ret baos.toByteArray();
}
}