mirror of
https://github.com/block/buzz.git
synced 2026-10-27 04:30:52 +00:00
chore: remove LLM-slop comments across the codebase (#1277)
Signed-off-by: Tyler Longwell <tlongwell@block.xyz> Co-authored-by: npub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67d <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Max <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Mari <95cae996907d7cab9f5dbf43c0f53edeac6ab0b032a6feae4abfd784e467b3f5@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Quinn <96f056ad5f2305c8ddf637dc65d048aa4c12d7daeb8867690e34fca46b0ef64c@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Sami <f4a42a97e594b77bdbd8ee35191c8b28a94a4cb871d96f32921558275421fb68@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Perci <5a968df9a7494b4e019b9ecf739e088ba61097b4312124e9a88ae5b42e3f5f3e@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Tyler Longwell <tlongwell@block.xyz>
This commit is contained in:
@@ -22,7 +22,6 @@ class SttTapProcessor extends AudioWorkletProcessor {
|
||||
this.offset = 0;
|
||||
this.transmitting = true; // default: open (VAD mode). PTT mode sets false on init.
|
||||
|
||||
// Listen for PTT state changes from main thread.
|
||||
// Direction: main→worklet (receives). The worklet→main direction uses
|
||||
// this.port.postMessage for PCM data — these don't conflict.
|
||||
this.port.onmessage = (e) => {
|
||||
@@ -43,20 +42,17 @@ class SttTapProcessor extends AudioWorkletProcessor {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Accumulate samples
|
||||
const remaining = this.buffer.length - this.offset;
|
||||
const toCopy = Math.min(input.length, remaining);
|
||||
this.buffer.set(input.subarray(0, toCopy), this.offset);
|
||||
this.offset += toCopy;
|
||||
|
||||
// Flush when buffer is full
|
||||
if (this.offset >= this.buffer.length) {
|
||||
// Transfer ownership for zero-copy
|
||||
this.port.postMessage(this.buffer, [this.buffer.buffer]);
|
||||
this.buffer = new Float32Array(960);
|
||||
this.offset = 0;
|
||||
|
||||
// Handle leftover samples
|
||||
if (toCopy < input.length) {
|
||||
const leftover = input.subarray(toCopy);
|
||||
this.buffer.set(leftover);
|
||||
|
||||
Reference in New Issue
Block a user