summaryrefslogtreecommitdiffstats
path: root/bin/ogg-maker
blob: 82e2f8c69fa3ff3417d79d1c858eb4eee0ce26f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
filename="$1"
outname=$(echo $1 | sed 's/^\(.*\)\..*/\1/').ogg
if [ "$filename" == "$outname" ]; then
  ffmpeg -i $filename tmp_$outname
  sox --norm=3 tmp_$outname tmp2_$outname silence 1 0.1 1% reverse silence 1 0.1 1% reverse rate 44100
  rm tmp_$outname
  vorbisgain tmp2_$outname
  mv tmp2_$outname $outname
else
  ffmpeg -i $filename tmp_$outname
  sox --norm=-3 tmp_$outname $outname silence 1 0.1 1% reverse silence 1 0.1 1% reverse rate 44100
  rm tmp_$outname
  vorbisgain $outname
  rm $filename
fi