Skip to content

Instantly share code, notes, and snippets.

@tytydraco
Created October 6, 2022 04:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tytydraco/a69d7c707c0d7ff9792416ccc1ead8c3 to your computer and use it in GitHub Desktop.
Save tytydraco/a69d7c707c0d7ff9792416ccc1ead8c3 to your computer and use it in GitHub Desktop.
A bash script to degrade audio from a container.
#!/usr/bin/env bash
trap 'echo Ignoring' INT
filename="$(basename -- "$1")"
ext="${filename##*.}"
filenameNoExt="${filename%.*}"
dir="$(dirname "$1")"
new="$dir/degraded_$filenameNoExt.$ext"
echo "Degrading audio for $1"
ffmpeg -hide_banner -v error -nostats -nostdin -i "$1" -b:a 16k "$new" || exit 1
mv "$new" "$1"
@tytydraco
Copy link
Author

Designed to be used in https://github.com/tytydraco/meow_dart. Pass in like this:

meow_dart ... -c ./degrade_audio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment