Skip to content

Instantly share code, notes, and snippets.

@alessandrostone
Last active January 6, 2019 21:38
Show Gist options
  • Save alessandrostone/ef33838bebb261c397f5d0b3036c826e to your computer and use it in GitHub Desktop.
Save alessandrostone/ef33838bebb261c397f5d0b3036c826e to your computer and use it in GitHub Desktop.
Generates small square waveform png's for every wav file using audiowaveform
#!/usr/bin/env zsh
# _
# ___ ___ ._ _ ___ _ _ ___ _| |_ ___ ___ _ _ _ ___ _ _ ___ ___
# / . |/ ._>| ' |/ ._>| '_><_> | | | / ._>|___|| | | |<_> || | |/ ._><_-<
# \_. |\___.|_|_|\___.|_| <___| |_| \___. |__/_/ <___||__/ \___./__/
# <___'
# Made with love by Alessandro Aresta on Sun Jan 06 2019
# generate-waves
# Generates small square waveform png's for every wav file
# requires audiowaveform (https://waveform.prototyping.bbc.co.uk)
function generate-waves() {
for file in ./**/*[.WAV,.wav]; do
echo "generate-waves"
echo "Batch Generating Audio Waves Images"
audiowaveform -z auto -b 8 --border-color 00522B --background-color 4E9E7A --waveform-color 00FFCB --no-axis-labels -w 128 -h 128 --amplitude-scale auto -i $file -o $file.png
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment