[google-appengine] Re: MP3 Data Retreival

2009-11-26 Thread MajorProgamming
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  wrote:
> On Thu, Nov 26, 2009 at 5:14 AM, MajorProgamming  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 google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.




[google-appengine] Re: MP3 Data Retreival

2009-12-07 Thread Hazzadous
Without retrieving the file, you may be able to use the filename or
other data on the site to guess the artist/title and from this, query
something like musicbrainz.  If you can actually retrieve the file,
you may be able to either get the mbid or more reliable artist album
track data to use in the query.  But no mb entry and its down to
guesswork.

On Nov 26, 5:14 am, MajorProgamming  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,

--

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




Re: [google-appengine] Re: MP3 Data Retreival

2009-11-26 Thread Eli Jones
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 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  wrote:
> > On Thu, Nov 26, 2009 at 5:14 AM, MajorProgamming 
> 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 google-appeng...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com
> .
> 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 google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.




Re: [google-appengine] Re: MP3 Data Retreival

2009-11-26 Thread Eli Jones
Also, it would need to be a fixed bitrate.. if it's variable bitrate, I
think you're sort of out of luck.

though, sounds like its a pain to do on your own.. there are no doubt
libraries to do it for you.

for python, I see there is:  Pymad

anyway, have fun.

On Thu, Nov 26, 2009 at 6:04 PM, Eli Jones  wrote:

> 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 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  wrote:
>> > On Thu, Nov 26, 2009 at 5:14 AM, MajorProgamming 
>> 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 google-appeng...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine+unsubscr...@googlegroups.com
>> .
>> 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 google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.




Re: [google-appengine] Re: MP3 Data Retreival

2009-11-26 Thread Niklas Rosencrantz
On Thu, Nov 26, 2009 at 10:45 PM, MajorProgamming 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?
>
Very likely most times though variable bitrates, faking descriptives, custom
setups may trick us. Experimental can work, at least (re)sample, Nyquist
theorem good theoretical background. Some os fork the actual file instead of
getting descriptives. In short many ways supporting we can.

>
> On Nov 26, 2:37 am, Niklas Rosencrantz  wrote:
> > On Thu, Nov 26, 2009 at 5:14 AM, MajorProgamming 
> 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 google-appeng...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com
> .
> 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 google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.




Re: [google-appengine] Re: MP3 Data Retreival

2009-12-07 Thread Rafael Nunes
I'm actually doing that with 'exiftool'.
http://www.sno.phy.queensu.ca/~phil/exiftool/

In a command line:
exiftool audio.mp3
(And it will return a list of properties)

exiftool -Duration audio.mp3
(Will return just the time duration)

And it will works for a bunch of media types(wmv, wma, jpg, etc)

--Rafael

Eli Jones wrote:
> Also, it would need to be a fixed bitrate.. if it's variable bitrate, 
> I think you're sort of out of luck.
>
> though, sounds like its a pain to do on your own.. there are no doubt 
> libraries to do it for you.
>
> for python, I see there is:  Pymad
>
> anyway, have fun.
>
> On Thu, Nov 26, 2009 at 6:04 PM, Eli Jones  > wrote:
>
> 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
> mailto:sefira...@gmail.com>> 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  > wrote:
> > On Thu, Nov 26, 2009 at 5:14 AM, MajorProgamming
> mailto:sefira...@gmail.com>> 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
> google-appengine@googlegroups.com
> .
> To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com
> .
> 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 google-appeng...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-appengine+unsubscr...@googlegroups.com.
> 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 google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.