Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 13 additions & 5 deletions whisper.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down