I have a folder with ~1600+ mp3 files, and i want to organize it in multiple “albums”, i.e. subfolders where the total duration of the audio files inside doesn’t exceed 74 minutes (the size of an Audio CD).
So i need to make a bash script that loops through all of the ~1600+ files, and start moving them to a subfolder, like Volume 1
. When this subfolder is near exceeding the 74-minute limit, it should create a new subfolder (eg. Volume 2
) and resume moving to that folder instead, next to Volume 3
and so on.
The reason i’m asking here is because, although i have some idea about how logically this bash script should operate, i don’t know how to get the duration of an audio file, let alone control the flow to switch folders when the 74-minute limit is hit (or about to be hit).