massive rewrite using flake-parts

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2022-12-08 01:00:12 +05:30
parent dfd8c57b60
commit aaf19ee844
45 changed files with 245 additions and 531 deletions

View File

@@ -0,0 +1,16 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p ffmpeg sox
IFS=$'\n'
for i in $(ls *$3)
do
if [ $1 = "320" ]; then
ffmpeg -i "$i" -codec:a libmp3lame -b:a 320k -map_metadata 0 -id3v2_version 3 "$2/${i%.$3}".mp3
elif [ $1 = "v0" ]; then
ffmpeg -i "$i" -codec:a libmp3lame -q:a 0 -map_metadata 0 -id3v2_version 3 "$2/${i%.$3}".mp3
elif [ $1 = "alactoflac" ]; then
ffmpeg -i "$i" -codec:a flac -map_metadata 0 -id3v2_version 3 "$2/${i%.$3}".flac
else
sox "$i" -G -b 16 "$2/${i%.$3}".flac rate -v -L 48000 dither
fi
echo $i
done