diff --git a/extensions/index.ts b/extensions/index.ts index 47f4ddd..7570899 100644 --- a/extensions/index.ts +++ b/extensions/index.ts @@ -144,11 +144,13 @@ function parseBooleanish(input: string): boolean | undefined { return undefined; } -function playCue(kind: "start" | "stop") { +function playCue(kind: "start" | "stop" | "error") { if (!config.soundsEnabled) return; const args = kind === "start" ? ["-q", "-n", "synth", "0.05", "sine", "880", "fade", "q", "0.01", "0.05", "0.02"] - : ["-q", "-n", "synth", "0.04", "sine", "660:440", "fade", "q", "0.005", "0.04", "0.02"]; + : kind === "stop" + ? ["-q", "-n", "synth", "0.04", "sine", "660:440", "fade", "q", "0.005", "0.04", "0.02"] + : ["-q", "-n", "synth", "0.15", "sawtooth", "150", "fade", "q", "0.01", "0.15", "0.02"]; const proc = spawn("play", args, { stdio: "ignore", detached: true }); proc.on("error", () => {}); proc.unref(); @@ -438,8 +440,9 @@ export default function (pi: ExtensionAPI) { Reflect.set(globalThis, VOICE_HANDLER_SYMBOL, (data: string): boolean => { if (recording && matchesKey(data, Key.enter)) { keyPressed = false; + playCue("error"); void stopRecording(ctx, pi, false, true); - return false; + return true; } if (recording && config.mode === "paste" && !isKeyRelease(data) && !matchesKey(data, keyId)) {