1
0
Fork 0

Add 'flac2opus.sh'

This commit is contained in:
MGislv 2022-09-02 16:14:33 +00:00
parent 311522de86
commit f8e8d7894c
1 changed files with 17 additions and 0 deletions

17
flac2opus.sh Normal file
View File

@ -0,0 +1,17 @@
#!/bin/bash
read -p 'Input bitrate: ' BITRATE
if [[ -z "$BITRATE" ]]; then
BITRATE=160
fi
read -p 'Gain db: ' GAIN
if [[ -z "$GAIN" ]]; then
GAIN='-2'
fi
mkdir -p opus
for i in ./*.flac; do
sox -V "$i" -t flac --comment '' - gain $GAIN rate -v 48000 | opusenc --bitrate $BITRATE \
- "./opus/${i/%flac/ogg}"
done