I want the following loop to go through m4a files AND webm files. At the moment I use two diffrent loops, the other one just replaces all the m4a from this loop. Also the files that ffmpeg outputs should remove a m4a extension if it was a m4a file, and a webm extension if it was a webm file. And replace that with mp3. (As it does here with m4a). I have no Idea how to do it, I think it has something to do with regex expressions, but I have no idea how really use them nor have I ever found a good tutorial/documentation, so if you have one, please link it aswell.
for i in *.m4a ; do
echo "Converting file $converted / $numfiles : $i"
ffmpeg -hide_banner -loglevel fatal -i "$i" "./mp3/${i/.m4a}.mp3"
mv "$i" ./done
converted=$((converted + 1))
done
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…