Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 14 of 14
  1. #1
    New Coder
    Join Date
    Aug 2002
    Posts
    27
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Length of MP3 Files

    We're putting together a site that will enable people to download MP3s (all created by the owner of the site, so no copyright problems!), and we need to be able to display certain types of information.

    We're running an ASP script that will display all the MP3 files and their sizes that are in a certain directory - this isn't a problem. What the client wants to know is whether we can automatically display the length of the file in seconds?

    Or is this just a ridiculous question and not even remotely possible?

    Thanks

  • #2
    Regular Coder
    Join Date
    Mar 2003
    Posts
    241
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It is very possible, but you will need a third-part component for this.

    http://www.aspin/ is my favorite site for these kind of things [3rd party tools], they have all kinds of stuff there!

    If you don't find anything there, try a google-search.

  • #3
    New Coder
    Join Date
    Aug 2002
    Posts
    27
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks for that - I'll take a look.

  • #4
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    I've just done some (very hasty) calculations with my trusty Winamp:

    Take 10 (128kb) tunes at random
    Divide bytes by seconds
    Find average

    Result: divide the filesize (in bytes) by 16040 to get time in seconds.


  • #5
    Regular Coder
    Join Date
    Mar 2003
    Posts
    241
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Come to think about it, I may have a link for you reg. this.

    It is a component for mIRC, but I'm not sure it can be used on IIS, but you could try to install it, and report here what the outcome was.


    http://www.base.is/thecrew/

    The file you would want to download is titled WA link 1.2
    There is source-code included, it's written in delphi by the way.

  • #6
    New Coder
    Join Date
    Aug 2002
    Posts
    27
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks all.

    This aspect of the site needs to be put on hold for a few days as we need to work on some other areas of the site, but I'll report back with my findings based on your responses.

    Thanks again.

  • #7
    Regular Coder
    Join Date
    Oct 2003
    Location
    London, UK
    Posts
    411
    Thanks
    0
    Thanked 1 Time in 1 Post
    VBR MP3z will throw a spanner in the works, and even Winamp used to have trouble...

    Unfortunately to estimate a playing time you must scan through all the frame headers, so here's a few links which will help you to write your own frame header parser in VBScript. It's best to use a ADODB.Stream object for fast, efficient binary manipulation, and you'll have to bear in mind that MP3z might be truncated or otherwise corrupted, and handle such events appropriately:

    http://www.mp3-tech.org/programmer/frame_header.html
    http://www.dv.co.yu/mpgscript/mpeghdr.htm#MPEG%20HEADER
    http://gabriel.mp3-tech.org/mp3infotag.html


    However, the information in this thread might prove helpful in taking shortcuts (and possibly getting a more accurate result):
    http://forum.sonique.com/showthread.php?threadid=6605

    Marcus Tucker / www / blog
    Web Analyst Programmer / Voted SPF "ASP Guru"

  • #8
    Regular Coder
    Join Date
    Aug 2003
    Posts
    565
    Thanks
    0
    Thanked 0 Times in 0 Posts
    cool links, very useful for me as well... thanx...

    <edit>
    posting from NY M@rco aren't you?
    </edit>
    Last edited by jeskel; 11-27-2003 at 10:51 PM.

  • #9
    Regular Coder
    Join Date
    Oct 2003
    Location
    London, UK
    Posts
    411
    Thanks
    0
    Thanked 1 Time in 1 Post
    Just in the middle of packing... flying out in 14 hrs' time... but well remembered!
    Marcus Tucker / www / blog
    Web Analyst Programmer / Voted SPF "ASP Guru"

  • #10
    Regular Coder
    Join Date
    Mar 2003
    Posts
    241
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [offtopic] Say halu to NY from me will ya ?
    Lovely city, New York. I've been there only once but I'm going back there again in February next year

    [ontopic] Nice links M@cro!
    I'm saving those in my bookmarks.

  • #11
    New Coder
    Join Date
    Aug 2002
    Posts
    27
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks M@rco.

  • #12
    Regular Coder
    Join Date
    Oct 2003
    Location
    London, UK
    Posts
    411
    Thanks
    0
    Thanked 1 Time in 1 Post
    You're all welcome, but I should say that it took me only 2 mins to find and skim thru those pages with the help of my good friend Google... try it... you might like it!

    Marcus Tucker / www / blog
    Web Analyst Programmer / Voted SPF "ASP Guru"

  • #13
    Regular Coder
    Join Date
    Aug 2003
    Posts
    565
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hum... personnaly I was not looking for that kind of links but since you gave them, I checked them and thought that they would useful soon or later. That's why I was enthusiastic about it

    <edit>
    I was manly posting to wish you a good trip to NY
    </edit>
    Last edited by jeskel; 11-30-2003 at 12:27 AM.

  • #14
    Regular Coder
    Join Date
    Oct 2003
    Location
    London, UK
    Posts
    411
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thanks! Having a great time so far... check on my progress here if you're interested! lol
    Marcus Tucker / www / blog
    Web Analyst Programmer / Voted SPF "ASP Guru"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •