I do not believe there is information in the mp3 header that tell you how
long it actually is (I think this is just a fluke.. or maybe they figured
"Oh, they can just calculate it").

You have to get the bitrate (say, 128 kbps) and then find out the total size
of the mp3.. and use that to calculate what the runtime will end up being.

On Thu, Nov 26, 2009 at 5:45 PM, MajorProgamming <[email protected]>wrote:

> That's great info to know. But I more specifically wanted to get the
> runtime of the file (i.e. in hours, minutes, seconds). Any way to do
> that?
>
> On Nov 26, 2:37 am, Niklas Rosencrantz <[email protected]> wrote:
> > On Thu, Nov 26, 2009 at 5:14 AM, MajorProgamming <[email protected]>
> wrote:
> >
> > > Is there any way to somehow fetch an external MP3 file (i.e. from
> > > another website), and then calculate the length of the MP3 file.
> >
> > > I don't need the actual data of the file, I just want the length of it
> > > (time it runs).
> >
> > > Keep in mind that these files can be as big as 25MB...
> >
> > > Thanks,
> >
> > Hello,
> > Good question guaranteed to depend on host config (could be custom or
> > fake descriptions) while one mentioned way is use HTTP HEAD
> > #Call HTTP HEAD in Python
> > import httplib
> > conn=httplib.HTTPConnection("www.abc.com")
> > conn.request("HEAD", "/dir/file1.mp3")
> > res=conn.getresponse()
> > fileSize=res.getheader('content-length')
> > #or res.getheaders() for all headers
> > conn.close()
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-appengine%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.


Reply via email to