I\'m looking for a way to find out the duration of a audio file (.wav) in python. So far i had a look at python wave library, mutagen, pymedi
To find length of music file, audioread module can be used,
install audioread: pip install audioread
then use this code:
import audioread
with audioread.audio_open(filepath) as f:
totalsec = f.duration
min,sec = divmod(totalsec,60) # divides total time in minute and second
#and store it in min and sec variable respectively