Files
speech/app/ui/pcm-processor.js
du5t 56e637a300 Initial commit: ASR v2 with multi-venv isolation
- faster-whisper, Qwen3-ASR, gateway 각 컴포넌트별 Python venv 분리
- 기본언어 한국어(ko)
- 처리내역 탭: 목록/상세/원본파일 재생/삭제
- 백엔드별 동적 모델 드랍다운
- /history, /uploads API 추가
- 기존 인스턴스(port 18100) 보존, 신규 port 18101

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 00:24:36 +09:00

30 lines
802 B
JavaScript

// AudioWorklet processor — accumulates 4096 samples (~256ms at 16kHz) before sending
class PCMProcessor extends AudioWorkletProcessor {
constructor() {
super();
this._chunks = [];
this._total = 0;
this._target = 4096;
}
process(inputs) {
const ch = inputs[0] && inputs[0][0];
if (ch && ch.length > 0) {
this._chunks.push(ch.slice());
this._total += ch.length;
if (this._total >= this._target) {
const out = new Float32Array(this._total);
let offset = 0;
for (const c of this._chunks) { out.set(c, offset); offset += c.length; }
this._chunks = [];
this._total = 0;
this.port.postMessage(out.buffer, [out.buffer]);
}
}
return true;
}
}
registerProcessor('pcm-processor', PCMProcessor);