Python Forum
VLClib get_duration() not working
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VLClib get_duration() not working
#1
I am using VLClib to create a music player, the actual player is a GUI but the code I need help with does not change or interact with the GUI (yet).

I am trying to find the duration of the song before it starts playing (so I can turn it into some sort of duration bar later on), but I am having trouble getting it to work.

I have tried to find alternative methods of getting the duration of a song but cannot find any.

# So far I have this
print(s.get_duration())
This, should print the medias length in ms, which I can convert to seconds, but it does nothing.

I am working with .mp3, .wav and .oog - But I will be expanding my media types in the future. So if there is a solution, it has to work with those file types.

Thanks in advance!
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020