Warning: session_start(): open(/var/lib/php/sessions/sess_amrsv7rb5si3sh2saifroev2ui, 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
!7
lib 1009770 // tritonus share
lib 1009766 // tritonus AudioOutputStream
import org.tritonus.share.sampled.file.*;
import org.tritonus.sampled.file.*;
static JButton btn;
static Flag flag; // stop flag
static AudioFormat format;
p {
format = javaSound_monoCDQuality°;
start();
swing {
showControls(jcenteredline(btn = jbutton("Start", f btn)));
}
}
svoid btn {
if (flag == null || flag.isUp()) start(); else stop();
}
svoid start {
setText(btn, "Stop");
flag = new Flag;
final File wavFile = countTillNewFile(prepareProgramFile("recorded-"), ".wav");
TSeekableDataOutputStream dataOut = new(wavFile);
final AudioOutputStream audioOut = new WaveAudioOutputStream(
format, AudioSystem.NOT_SPECIFIED, dataOut);
final OutputStream out = new OutputStream {
public void write(int b) throws IOException {
audioOut.write(new byte[] { (byte) b }, 0, 1);
}
public void write(byte[] b) throws IOException {
audioOut.write(b, 0, l(b));
}
public void write(byte[] b, int o, int l) throws IOException {
audioOut.write(b, o, l);
}
};
thread {
captureAudioFromLine3(format, out, flag);
print(wavFile);
print("Actually done. " + l(wavFile) + " bytes");
}
}
svoid stop {
setText(btn, "Start");
flag.raise();
}