MCPcopy Create free account
hub / github.com/ACM-VIT/conclave / flush

Method flush

apps/web/public/transcript-pcm-processor.js:19–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17 }
18
19 flush() {
20 if (this.writeIndex <= 0) return;
21 const output = this.buffer.slice(0, this.writeIndex);
22 const level =
23 this.levelCount > 0
24 ? Math.sqrt(this.levelSumSquares / this.levelCount)
25 : 0;
26 this.port.postMessage(
27 { type: "pcm", buffer: output.buffer, level },
28 [output.buffer],
29 );
30 this.buffer = new Int16Array(this.chunkSamples);
31 this.writeIndex = 0;
32 this.levelSumSquares = 0;
33 this.levelCount = 0;
34 }
35
36 appendSample(sample) {
37 const clamped = Math.max(-1, Math.min(1, sample || 0));

Callers 10

constructorMethod · 0.95
appendSampleMethod · 0.95
_emscripten_glFlushFunction · 0.45
_emscripten_glFlushFunction · 0.45
_emscripten_glFlushFunction · 0.45
_emscripten_glFlushFunction · 0.45
_emscripten_glFlushFunction · 0.45
_emscripten_glFlushFunction · 0.45
storeSetCookieHeaderMethod · 0.45
clearCookiesMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected