Allow me to continue this conversation with myself…
During lunch, I realized that it would be easier to run all this from Raycast. So now…
1. I run a Raycast Script
This starts a process recording my microphone.
Here’s the Script:
#!/bin/zsh
# @raycast.title Add Entry
# @raycast.author Chris Pennington
# @raycast.description Add a new entry to Day One.
# @raycast.mode fullOutput
#
# @raycast.icon dayone.png
#
# @raycast.packageName DayOne
# @raycast.schemaVersion 1
ffmpeg -f avfoundation -i ":0" ~/automations/day_one_transcriptions/audiocapture.mp3
Here’s the resulting view:
2. Stop process
I press ctrl + c to stop the process in Raycast.
3. Hazel reacts.
Hazel runs the script and uses a native notification to notify me when it’s done rather than the hack with KM.
Here’s the script:
whisper $1 --language English --model large-v2 --fp16 False --output_dir . --output_format txt
TRANSCRIPTION=$(cat "./audiocapture.txt")
dayone2 --journal Journal new "$TRANSCRIPTION" --tags transcribed
rm "./audiocapture.mp3" "./audiocapture.txt"
osascript -e 'display notification "Added to Day One!" with title "Transcription Complete"'
4. Notification displays
The native macOS notification runs to tell me everything is done.
I wouldn’t mind figuring out how to get ffmpeg to stop recording after a break of 5 seconds or something, but the hour or so I’ve spent is probably sufficient. I’m happy enough with the result. Leaving this for anyone else who wants to pick it up and run.