improvement these days with massive language fashions (LLMs). Numerous the main focus is on the question-answering you are able to do with each pure text-based fashions, or vision-language fashions (VLMs), the place you can too enter pictures.
Nonetheless, there may be one other dimension that has advanced a ton over the previous couple of years: Audio. Fashions that may each transcribe (speech -> textual content), speech synthesis (textual content -> speech), and likewise speech-to-speech, the place you’ve gotten an entire dialog with a language mannequin, with audio going each out and in.
On this article, I’ll talk about how I’m using the event throughout the audio mannequin area to my benefit, changing into an much more environment friendly programmer.

Motivation
My main motivation for writing this text is that I’m frequently in search of methods to develop into a extra environment friendly programmer. After utilizing the ChatGPT cellular app for some time, I found their transcription possibility (the microphone icon to the suitable within the person enter area). I used the transcription and rapidly realized how a lot better this transcription is in comparison with others I’ve used earlier than, akin to Apple’s built-in iPhone transcription.
OpenAI’s transcription virtually all the time captures all of my phrases, with only a few errors. Even when I exploit much less widespread phrases, for instance, acronyms associated to laptop science, it’s nonetheless in a position to decide up what I’m saying.

This transcription was solely accessible within the ChatGPT app. Nonetheless, I do know that OpenAI has an API endpoint for his or her Whisper mannequin, which is (presumably) the identical mannequin they’re utilizing to transcribe textual content within the app. I thus needed to set this mannequin up on my Mac to be accessible by way of a shortcut.
(I do know there are apps akin to Macwhisper accessible, however I needed to develop a totally free resolution, apart from the prices of the API calls themselves)
Conditions
- Alfred (I can be utilizing Alfred on the Mac to set off some scripts. Nonetheless, options to this additionally exist. Basically, you want a solution to set off scripts in your Mac / PC from a hotkey.
Execs
The principle benefit of utilizing this transcription is which you could enter phrases into your laptop extra rapidly. Once I sort as rapidly as I can on my laptop, I’m not even in a position to attain 100 phrases per minute, and if I’m to sort at that velocity, I actually need to focus. Nonetheless, the typical speaking velocity is at a minimum of 110, according to this article.
This implies you generally is a lot simpler if you’ll be able to communicate your phrases with transcription, as a substitute of typing them out on the keyboard.
I believe that is particularly related after the rise of enormous language fashions akin to ChatGPT. You spend extra time prompting the language fashions, for instance, asking inquiries to ChatGPT, or prompting the cursor to implement a function, or fixing a bug. Thus, using the English language is rather more prevalent now than earlier than, in comparison with using programming languages akin to Python instantly.
Word: After all, you’ll nonetheless be writing quite a lot of code, however from expertise, I spend much more time prompting the cursor, for instance, with intensive English prompts, during which case, utilizing this transcription saves me quite a lot of time.
Cons
There can, nonetheless, be some downsides to utilizing the transcription as properly. One of many most important ones is that quite a lot of instances, you don’t want to talk out loud when programming. You may be sitting within the airport (as I’m when writing this text), and even in your workplace. Once you’re in these eventualities, you in all probability don’t need to disturb these round you by talking out loud. Nonetheless, if you’re sitting in a house workplace, that is naturally not an issue.
One other unfavourable aspect is that smaller prompts won’t be that a lot quicker. Think about this: for those who simply need to write a immediate of a single sentence, it can, in lots of eventualities, be quicker simply to sort the immediate out by hand. That is due to the delay in beginning, stopping, and transcribing audio into textual content. Sending the API name takes a little bit little bit of time, and the shorter the immediate you’ve gotten, the bigger fraction of the time you need to spend ready for the response.
The best way to implement
You may see the code I used in this article on my GitHub. Nonetheless, you additionally want so as to add hotkeys to run the scripts.
First, you need to:
- Clone the GitHub repository:
git clone https://github.com/EivindKjosbakken/whisper-shortcut.git
- Create a digital setting referred to as .venv and set up the required packages:
python3 -m venv .venv
supply .venv/bin/activate
pip set up -r necessities.txt
- Get an OpenAI API Key. You are able to do that by:
- Going to the OpenAI API Overview, logging in/making a profile
- Go to your profile, and API Keys
- Create a brand new key. Keep in mind to repeat the important thing, as you will be unable to see it once more
The scripts from the GitHub repository work by:
- start_recording.sh — begins recording your voice. The primary time you utilize this, it can ask you for permission to make use of the microphone
- stop_recording.sh — sends a cease sign to the script to cease recording. Then sends the recorded audio to OpenAI for transcription. Moreover, it provides the transcribed textual content to your clipboard and pastes the textual content in case you have a textual content area in your PC chosen
The complete repository is offered with an MIT license.
Alfred
You will discover the Alfred workflow on the GitHub repository right here: Transcribe.alfredworkflow.
That is how I arrange the Alfred workflow:

You may merely obtain it and add it to your Alfred.
Additionally, keep in mind to have a terminal window open everytime you need to run this script, as you activate the Python script from the terminal. I needed to do it this manner as a result of if the script was activated instantly from Alfred, I received permission points. The primary time you run the script, you have to be prompted to present your terminal entry to the microphone, which you must approve.
Price
An essential consideration when utilizing APIs akin to OpenAI Whisper is the price of the API utilization. I might take into account the price of utilizing OpenAI’s Whisper mannequin reasonably excessive. As all the time, the price is totally depending on how a lot you utilize the mannequin. I might say I exploit the mannequin as much as 25 instances a day, as much as 150 phrases, and the price is lower than 1 greenback per day.
This implies, nonetheless, that for those who use the mannequin quite a bit, you possibly can see prices as much as 30 {dollars} per 30 days, which is unquestionably a considerable value. Nonetheless, I believe it’s essential to be aware of the time financial savings you’ve gotten from the mannequin. If every mannequin utilization saves you 30 seconds, and you utilize it 20 instances per day, you’ve gotten simply saved ten minutes of your day. Personally, I’m keen to pay one greenback to save lots of ten minutes of my day, performing a job (writing on my keyboard), that doesn’t actually grant me some other profit. If any, utilizing your keyboard might contribute to the next danger of accidents akin to carpal tunnel syndrome. Utilizing the mannequin is thus undoubtedly value it for me.
Conclusion
On this article, I began off discussing the immense advances inside language fashions in the previous couple of years. This has helped us create highly effective chatbots, saving us huge quantities of time. Nonetheless, with the advances of language fashions, now we have additionally seen advances in voice fashions. Transcription utilizing OpenAI Whisper is now close to good (from private expertise), which makes it a strong software you should use to enter phrases in your laptop extra successfully. I mentioned the professionals and cons of utilizing OpenAI Whisper in your PC, and I additionally went step-by-step by how one can implement it by yourself laptop.