diff --git a/dashboard/frontend/src/lib/voice.js b/dashboard/frontend/src/lib/voice.js index 1493c03..2586df3 100644 --- a/dashboard/frontend/src/lib/voice.js +++ b/dashboard/frontend/src/lib/voice.js @@ -3,6 +3,7 @@ const LANG_LABELS = ["EN", "普", "粤"]; const TALK_MODES = ["auto", "tap", "hold"]; const MODE_LABELS = { auto: "Auto", tap: "Tap", hold: "Hold" }; const NOISE = /^[\s│┃┆┇┊┋─━┄┅┈┉═╌╍╔╗╚╝╠╣╦╩╬├┤┬┴┼╭╮╯╰░▒▓█▌▐▀▄⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏◐◑◒◓⣾⣽⣻⢿⡿⣟⣯⣷⠁⠂⠄⡀⢀⠠⠐⠈\-–—_=+*#~<>/.\\|,;:!?(){}\[\]]+$/; +const SKIP = /shortcuts|\/help|\/exit|press esc|ctrl[+-]|⌘|⎋|❯|^\$\s|^root@|^claude|^jimmy|^\[.*\]$/i; const MODE_COMMANDS = { "hold mode": "hold", "tap mode": "tap", "auto mode": "auto", "按住模式": "hold", "点击模式": "tap", "自动模式": "auto", @@ -202,7 +203,7 @@ export class VoiceSession { const row = buf.getLine(y); if (!row) continue; const text = row.translateToString(true).trim(); - if (text.length >= 4 && !NOISE.test(text)) lines.push(text); + if (text.length >= 4 && !NOISE.test(text) && !SKIP.test(text)) lines.push(text); } this._lastLine = curLine; if (lines.length) this._speak(lines.join(". "));