Warning: session_start(): open(/var/lib/php/sessions/sess_oo03ljob2ueg4h9ooiip2t4024, 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
import javax.sound.sampled.*;
static JPanel colorPanel;
p-subst {
swing {
tt();
colorPanel = singleColorPanelWithSize();
showControls(jFullCenter(colorPanel));
}
AudioFormat format = new AudioFormat(44100, 16, 1, true, true); // signed, big-endian
//TargetDataLine line = AudioSystem.getTargetDataLine(format);
DataLine.Info info = new DataLine.Info(TargetDataLine.class, format);
TargetDataLine line = (TargetDataLine) AudioSystem.getLine(info);
line.open(format);
byte[] data = new byte[64];
short[] buf = new short[l(data)/2];
line.start();
try {
while licensed {
int n = line.read(data, 0, l(data));
printWithMSTime("Bytes: " + n);
bytesToShorts_signedBigEndian(data, buf);
int min = min(buf), max = max(buf);
final double loudness = min(max(abs(min), abs(max))/32767.0, 1);
print("min: " + min + ", max: " + max + ", loudness: " + formatDouble(loudness, 2));
awt {
colorPanel.setBackground(blendColor(Color.black, Color.white, loudness));
}
}
} finally {
line.close();
}
}