W
W
wolf-98302015-04-09 21:00:39
Python
wolf-9830, 2015-04-09 21:00:39

How to find the duration of a track in python?

How do I get the duration of an .mp3 track using python?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2015-04-10
@wolf-9830

You can use the https://bitbucket.org/lazka/mutagen library .
Example for mp3:

from mutagen.mp3 import MP3
f = MP3('test.mp3')
print(f.info.length)

The result will be in seconds.

V
Vladimir Martyanov, 2015-04-09
@vilgeforce

pymedia.org not working?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question