From bfa7fedd18c13d30bd26bcc0b26f17a1094aa185 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 10 Aug 2023 22:18:41 -0300 Subject: [PATCH] catch ^c --- aider/voice.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aider/voice.py b/aider/voice.py index 5f6086cf5..f0879b319 100644 --- a/aider/voice.py +++ b/aider/voice.py @@ -46,6 +46,12 @@ class Voice: return f"Recording, press ENTER when done... {dur:.1f}sec {bar}" def record_and_transcribe(self): + try: + return self.raw_record_and_transcribe() + except KeyboardInterrupt: + return + + def raw_record_and_transcribe(self): self.q = queue.Queue() filename = tempfile.mktemp(suffix=".wav")