I'm setting up a site where users can upload various media file types(starting with just WMA for now), and their info is stored in a database and displayed on a browse page. Rather than have users enter a duration, i was wondering if anybody could think of a way to determine the duration of the file being uploaded by opening it and reading its contents.
All i'd really need is the bitrate information, which, at least in .wma, is stored early in the header of the file, from what i can see in notepad:
...ARц1У¤ ÉHö W i n d o w s M e d i a A u d i o 9 . 1 " 4 8 k b p s , 4 4 k H z , m o n o 1 - p a s s C B R a¡Ü«ŒG©ÏŽä ...
I guess i could parse the file until i hit a certain string type and go back and read it to a var, but i'm still pretty new to php at least, and not sure how to go about it.
Also looking for an easier way 🙂
If anyone could help, it'd be much appreciated!