transcribe a folder of m4a files to text

 #!/bin/bash
# convert_and_transcribe.sh
# 1. Rename spaces to underscores
for f in *\ *; do mv "$f" "${f// /_}"; done
# 2. Convert all .m4a files to .mp3
for f in *.m4a; do ffmpeg -i "$f" -acodec libmp3lame -ab 192k "${f%.m4a}.mp3"; done
# 3. Move original .m4a files to Trash
mv *.m4a ~/.local/share/Trash/files/ 2>/dev/null
# 4. Transcribe all .mp3 files using Whisper
for f in *.mp3; do whisper "$f" --model medium --language en --output_format txt --output_dir . --fp16 False; done

Popular posts from this blog

Automatically Fix Song Metadata and Filenames on Linux with Beets

throttle traffic on apache

script to show all files with disk usage sizes