Shell script trouble: transcribing files with Whisper

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

* I use Whisper (https://github.com/openai/whisper) to transcribe audio files.
* The following command works in my terminal:
Code: Select all
(full path)/whisper '(full path)/new.m4a' --model large --language en --fp16 False -o '(full path)/@dictations'

where (full path) means the actual full path to the command, file, or folder (as context requires).

* When I add an audio file of my own speech to a particular folder, I would like Hazel to run the basic command above on that file.
* I created a rule that matches any audio file added to that folder and runs the following embedded shell script for the shell /bin/zsh:
Code: Select all
for f in '$1'; do (full path)/whisper f --model large --language en --fp16 False -o '(full path)/@dictations'; done

* That rule fails, with Hazel reporting the following:
Code: Select all
Shellscript exited with non-successful status code: 1


Before posting, I checked Hazel's Help and made sure that I enclosed $1 in single quotation marks and used the full path of the command. But still no dice.

Am I doing something obviously wrong?

Thank you in advance for your help.
apkawel
 
Posts: 2
Joined: Thu Sep 18, 2014 10:18 am

Check to see if whisper requires any environment variables set. You can't assume that they will be set as they are in an interactive Terminal session.

You should also have your script print out everything to help debugging. If you turn on debug mode (https://www.noodlesoft.com/kb/hazel-debug-mode/), it will show that output in the logs.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support