Created
February 7, 2025 16:45
-
-
Save joshua-koehler/22aae69254a0472496ade5e41175cbc1 to your computer and use it in GitHub Desktop.
Compress mp3 file
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/bash | |
| bitrate=36 | |
| if [[ -n $2 ]] | |
| then | |
| bitrate=$2 | |
| fi | |
| inputfilename="$1" | |
| outputfilename="${inputfilename%.mp3}.bitrate${bitrate}.mp3" | |
| echo "Compressing into $outputfilename" | |
| ffmpeg -i $inputfilename -b:a ${bitrate}k -ac 1 $outputfilename |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment