Skip to content

Instantly share code, notes, and snippets.

@colin-marshall
Created May 19, 2017 14:36
Show Gist options
  • Save colin-marshall/c03edfaea3020331d53ec66507cb0d29 to your computer and use it in GitHub Desktop.
Save colin-marshall/c03edfaea3020331d53ec66507cb0d29 to your computer and use it in GitHub Desktop.
zsh command line function that recursively renders a spectrogram for all audio files in a directories
function render_spectrograms () {
setopt null_glob
for file in **/*.(wav|flac|mp3|m4a|aiff|aif); do
outfile="${file%.*}.png"
title_in_pic="${file%.*}"
sox "$file" -n spectrogram -t "$title_in_pic" -o "$outfile"
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment