Yea I’m using .ogg files and I think the length of the file is in the meta data in the file. I just dont know how to parse the file and get this information out. I have had a look at a couple of python libraries that let you extract data about vorbis ogg files. But I was hoping there was an easier way to get this information. Still learning python, so linking in libraries and things kind of haunts me.
I was really hoping for something like audioFactory.length to get the length of the file, but I dont think its implemented.
I have made a temporary solution by creating a class to hold information about the tracks, then just hardcoding in the length of the audio file in seconds. It works but I was hoping for a more elegant solution that would maybe let me loop through a directory of audio files and use them.