Forums » General Discussion Search

Getting float values from retruned data New Reply

Author Post
Posts: 2
Registered: Oct 07, 2009

For methods like getDuration(), how can I get the actual float value that IS the duration.

If I print the getDuration() method, I get "melka.echonest.ENTrack$ENDuration@c1192f".

For the getBeats() I found a trick around it... getBeats().length. Any replies are appreciated.

Posts: 666
Registered: Sep 08, 2008

jaych1000:

Which client library are you using? Is this melka's processing library? If so, I think you need to do something like:

float duration = track.getDuration().duration;

Perhaps Melka (the author of the library) will chime in.

Paul

Posts: 2
Registered: Oct 07, 2009

Yes it is melka's processing library. Thank you very much! That was valuable information and was exactly what I was looking for.

Posts: 5
Registered: Feb 18, 2009

Hi Jaych1000 There's a lot of different objects returned by the library. ENDuration is one of them. getDuration returns an ENDuration object, which contains the duration property. so as plamere said, you should use : float duration = track.getDuration().duration; or ENDuration d = track.getDuration(); float duration = d.duration.

I'm still working on a better version of the lib, but you can find a lot of infos here : http://www.melkaone.net/echonestp5/reference/index.html

Cheers

Reply to this Thread

You must log in to post a reply.