Warning: session_start(): open(/var/lib/php/sessions/sess_skdcg6and7tc5fnca0ndb2bsdv, 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
sclass OpusMachine implements IF0_Int, AutoCloseable {
InputStream in;
new ByteArraysPartialInputStream buffer;
new ArraysShortStream sampleStream;
OpusFromStream opusDecoder;
int channels = 1;
*(InputStream *in) {}
void init() ctex {
opusDecoder if null = new OpusFromStream(buffer, channels);
}
close { dispose in; }
bool pullFromDecoder() ctex {
while ping (true) {
short[] samples;
if ((samples = opusDecoder.nextSamples()) != null)
ret true with sampleStream.add(samples);
if (!pullFromSource()) false; // end of stuff
// we got new material from source, decode again
}
}
bool pullFromSource() {
ret fillBuffer();
}
swappable bool fillBuffer() {
if (in != null) {
byte[] buf = new[primarybufSize];
int n = in.read(buf);
if (n >= 0) {
buffer.write(takeFirst(buf, n));
true;
}
}
false;
}
// get next sample (pull mode)
public int get() ctex {
init();
int sample;
while ping ((sample = sampleStream.read()) == Int.MAX_VALUE) {
if (!pullFromDecoder())
ret Int.MAX_VALUE;
}
ret sample;
}
}