feat: add OpenRouter dictation and speech recognition settings
This commit is contained in:
@@ -27,6 +27,16 @@ class PcmCaptureProcessor extends AudioWorkletProcessor {
|
||||
super();
|
||||
this.frame = new Int16Array(2048);
|
||||
this.count = 0;
|
||||
// Whole-recording STT must include the final, partially filled frame.
|
||||
this.port.onmessage = (event) => {
|
||||
if (event.data?.type !== "flush") return;
|
||||
if (this.count > 0) {
|
||||
const tail = this.frame.slice(0, this.count);
|
||||
this.port.postMessage({ type: "audio", buffer: tail }, [tail.buffer]);
|
||||
this.count = 0;
|
||||
}
|
||||
this.port.postMessage({ type: "flushed" });
|
||||
};
|
||||
}
|
||||
|
||||
process(inputs) {
|
||||
|
||||
Reference in New Issue
Block a user