So i have the code:
import glob,os import random path = \'C:\\\\Music\\\\\' aw=[] for infile in glob.glob( os.path.join(path,\'*.mp3\') ): libr = infil
You can use mutagen to get the length of the song (see the tutorial):
from mutagen.mp3 import MP3 audio = MP3("example.mp3") print(audio.info.length)