def length(self):
    pathparts = self.file.rsplit('.', 1)
    fileformat = pathparts[1]
    song = AudioSegment.from_file(self.file, format=fileformat)
    return song.duration_seconds
def length(self):
    pathparts = self.file.rsplit('.', 1)
    fileformat = pathparts[1]
    song = AudioSegment.from_file(self.file, format=fileformat)
    return song.duration_seconds