mickekring / Diane

This is a basic prototype of the app Diane, which is a voice recorder using Whisper and GPT to process text and sends it to Obsidian
16 stars 2 forks source link

Cannot stop the recording #2

Open uwestephan1975 opened 1 year ago

uwestephan1975 commented 1 year ago

Hi Micke

I seem not to be able to stop the recording after I started it. These are the steps on the way:

  1. I get a warning when executing main.py:

uwestephan@Uwes-MacBook-Air Diane-main2 % python3 main.py /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pydub/utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)

  1. When I ignore the warning an start a recording by pressing the red button the following happens in the Terminal window:

_--- --- ---

Recording... Converting to mp3 Exception in Tkinter callback Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tkinter/init.py", line 1948, in call return self.func(*args) ^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/customtkinter/windows/widgets/ctk_button.py", line 553, in _clicked self._command() File "/Users/uwestephan/Python/Diane/Diane-main2/main.py", line 253, in command=lambda: record(self, icon_rec, icon_stop_rec), text="Spela in") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/uwestephan/Python/Diane/Diane-main2/main.py", line 108, in record convert_to_mp3(filename, mp3_filename) File "/Users/uwestephan/Python/Diane/Diane-main2/main.py", line 55, in convert_to_mp3 audio.export(output_file, format="mp3") File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pydub/audio_segment.py", line 963, in export p = subprocess.Popen(conversion_command, stdin=devnull, stdout=subprocess.PIPE, stderr=subprocess.PIPE) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1024, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1901, in _execute_child raise child_exception_type(errno_num, err_msg, errfilename) FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'

  1. When I now press the red "Stoppa inspelningen" button, nothing happens. I have to kill it manually.

Anny ideas what might have happened?

Best regards Uwe

mickekring commented 1 year ago

Hi! I see that you're using Python 3.11. I've only tested it with 3.9. I'll see if I can reproduce it. It'll take a couple of days...