@ -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 fals e;
return tru e;
}
if ( recording && config . mode === "paste" && ! isKeyRelease ( data ) && ! matchesKey ( data , keyId ) ) {