Last active
January 15, 2026 05:51
-
-
Save brokosz/38d24d6df1a44fffb5c42a00ef1a57ec to your computer and use it in GitHub Desktop.
Smart wrapper for parakeet-mlx audio transcription with sensible defaults - txt to stdout by default, SRT files next to source, easy redirection and dual output options.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/zsh | |
| if [[ "$1" == "--help" || "$1" == "-h" || $# -eq 0 ]]; then | |
| echo "Usage: parakeet [options] <audio_file>" | |
| echo "Format:" | |
| echo " -t, --txt: plain text file (default)" | |
| echo " -s, --srt: subtitle file next to input file" | |
| echo " -f, --file: force txt output next to source file" | |
| echo " -c, --copy-txt: also create txt file when using -s" | |
| echo "Output:" | |
| echo " -o, --output-dir <dir>: override output directory" | |
| echo "Processing:" | |
| echo " -v, --verbose: show processing details" | |
| echo " -b, --beam: use beam search (slower but more accurate)" | |
| echo " --no-chunk: disable chunking for short files" | |
| exit 0 | |
| fi | |
| format="txt" | |
| force_file="" | |
| copy_txt="" | |
| verbose="" | |
| decoding="greedy" | |
| chunk_duration="120" | |
| custom_output_dir="" | |
| while [[ $# -gt 0 ]]; do | |
| case $1 in | |
| -t|--txt) shift ;; | |
| -s|--srt) format="srt"; force_file="1"; shift ;; | |
| -f|--file) force_file="1"; shift ;; | |
| -c|--copy-txt) copy_txt="1"; shift ;; | |
| -o|--output-dir) custom_output_dir="$2"; shift 2 ;; | |
| -v|--verbose) verbose="--verbose"; shift ;; | |
| -b|--beam) decoding="beam"; shift ;; | |
| --no-chunk) chunk_duration="0"; shift ;; | |
| *) break ;; | |
| esac | |
| done | |
| if [[ -z "$force_file" && -z "$custom_output_dir" ]]; then | |
| parakeet-mlx "$1" --output-format "$format" --decoding "$decoding" --chunk-duration "$chunk_duration" $verbose | |
| else | |
| output_dir="${custom_output_dir:-$(dirname "$1")}" | |
| parakeet-mlx "$1" --output-dir "$output_dir" --output-format "$format" --decoding "$decoding" --chunk-duration "$chunk_duration" $verbose | |
| if [[ "$copy_txt" == "1" && "$format" == "srt" ]]; then | |
| parakeet-mlx "$1" --output-format "txt" --decoding "$decoding" --chunk-duration "$chunk_duration" $verbose | |
| fi | |
| fi |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Parakeet Transcription Wrapper
Smart wrapper around
parakeet-mlxwith sensible defaults for common transcription workflows.Features
Installation
Usage Examples
Works with any audio/video format that
parakeet-mlxsupports.