1
Fork 0

Add a to-mp3 function.

This commit is contained in:
Bauke 2024-08-10 12:17:38 +02:00
parent 8fdeb6dc1a
commit 39ac2b5f49
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 9 additions and 0 deletions

View File

@ -61,3 +61,12 @@ to-opus () {
ffmpeg -i "$input_file" -c:a libopus -b:a 128K "$output_file" ffmpeg -i "$input_file" -c:a libopus -b:a 128K "$output_file"
done done
} }
# Converts any given files to 128K MP3 using ffmpeg.
# to-mp3 <file ...>
to-mp3 () {
for input_file in "$@"; do
output_file="${input_file%.*}.mp3"
ffmpeg -i "$input_file" -map_metadata 0:s:a:0 -b:a 128K -y "$output_file"
done
}