diff --git a/README.org b/README.org index 831e842..0a9c59f 100644 --- a/README.org +++ b/README.org @@ -66,6 +66,7 @@ Few other variables for customising workflow: (setq whisper-transcription-buffer-name-function #'whisper--simple-transcription-buffer-name) #+end_src - =whisper-return-cursor-to-start=: By default when whisper.el is inserting transcribed text at the point where =whisper-run= is invoked, it keeps cursor at original point to better denote where transcribed text begins. Set this to =nil= to let cursor go to the end of the transcribed text. +- =whisper-curl-path=: Path to the curl executable. Default is =curl= (uses system PATH). Set this if you need to use a specific curl binary, e.g. ="/usr/local/bin/curl"= or ="/opt/homebrew/bin/curl"=. - =whisper-server-mode=: Choose between different transcription modes: - =nil= (default): Use whisper.cpp directly - =local=: Run whisper.cpp as a local HTTP server for better performance with multiple requests diff --git a/whisper.el b/whisper.el index 92e6b6b..868fe08 100644 --- a/whisper.el +++ b/whisper.el @@ -161,6 +161,13 @@ Possible values: :type 'integer :group 'whisper) +(defcustom whisper-curl-path "curl" + "Path to the curl executable. +This can be either just the executable name - +(if it's in PATH) or the full path to the curl binary." + :type 'string + :group 'whisper) + (defcustom whisper-openai-api-baseurl "https://api.openai.com/" "URL for OpenAI compatible transcription API endpoint." :type 'string @@ -205,6 +212,7 @@ non-interactive scripting where user only intends to run the functions in By default we create a timestamp based new buffer, but if you prefer to name it something simple and deterministic to avoid proliferation of such buffers then set it to `whisper--simple-transcription-buffer-name' instead." + :type 'function :group 'whisper) (defcustom whisper-return-cursor-to-start t @@ -548,10 +556,10 @@ PRE-PROCESSOR is a function that will be called first thing on the raw output." "Make curl request to URL with HEADERS and PARAMS and process response." (make-process :name "whisper-curl" - :command `("curl" "-s" - ,url - ,@(mapcan (lambda (h) (list "-H" h)) headers) - ,@(mapcan (lambda (p) (list "-F" p)) params)) + :command `(,whisper-curl-path "-s" + ,url + ,@(mapcan (lambda (h) (list "-H" h)) headers) + ,@(mapcan (lambda (p) (list "-F" p)) params)) :buffer (get-buffer-create whisper--stdout-buffer-name) :stderr (get-buffer-create whisper--stderr-buffer-name) :coding 'utf-8 @@ -792,7 +800,7 @@ escapes me right now, to get let bindings work like synchronous code." (if (eq whisper-install-whispercpp 'manual) (message "Compilation exited abnormally, but not deleting directory because installation is manual.") (progn - (delete-directory whisper--install-path t) + ;; (delete-directory whisper--install-path t) (message "Couldn't compile whisper.cpp. Check that you have Git, a C++ compiler and CMake installed."))) (display-buffer whisper--compilation-buffer) (throw 'early-return nil))