This script sends an audio file to OpenAI for transcription and stores the result in a JSON file. It works on macOS and Linux and doesn't require programming knowledge.
| Requirement | Description |
|---|---|
| OpenAI API key | Can be stored in the script or set in the environment. |
| macOS or Linux terminal | Needed to run the script. |
curl |
Usually preinstalled. |
-
Download the script Save
transcribe.shanywhere you like. -
Make it executable
chmod +x transcribe.sh -
Provide your OpenAI API key You have two options:
Option How Set it inside the script Edit the line API_KEY_IN_FILE=""and put your key inside the quotes.Use an environment variable Run export OPENAI_API_KEY="your_key"in the terminal.If both are provided, the key inside the script takes priority.
./transcribe.sh <audio-file> <output-json-file>
Example:
./transcribe.sh "Downloads/New Recording 32.m4a" transcription.json
A JSON file will be created with the transcription text and metadata.
The output file is standard JSON and can be opened with any text editor.