1

if I use the os module How to get information about the length of an audio file (for example mp3 ) from Windows ?

I didn't find the answer in the documentation os.stat()

information about the length of any media files is already in Windows. how to get it?

OdessaUA
  • 13
  • 3

1 Answers1

0

You should be able to use the MP3 module from mutagen.

from mutagen.mp3 import MP3
file = MP3("path")
print(file.info.length)

See similar: enter link description here

teddyzhng
  • 80
  • 7