PDA

View Full Version : Reading Length



jaklithn
03-17-2008, 03:07 AM
I would like to read the song length from the file.
The file is created with LAME MP3 ABR or VBR and the length can therefore not be calculated from bitrate and size.

In the documentation page http://www.dbpoweramp.com/developer-scripting-dmc.htm
I read the following description:

Read Audio Properties from File: .AudioProperties ([in] BSTR File, [out, retval] BSTR *OutProps )
File: Source filename.
Returns a string containing audio properties.

How can I specify "OutProps"?
What values can be used?
When I reference the dll in VB.Net the .AudioProperties just take ONE parameter.

Spoon
03-17-2008, 03:31 AM
Is there a VB example of how to use it on that page?

jaklithn
03-17-2008, 02:39 PM
Is there a VB example of how to use it on that page?

Yes, as you probably noticed there are examples for C++, C*, VB.Net and VBScript. But there are minor differences in the examples.
The C++ example is the only one that makes use of the documented signature for AudioProperties that takes two parameters.
Does that mean the implementation for the other languages hides part of the functionality?

Spoon
03-17-2008, 03:13 PM
Yes they return the value on the call.

jaklithn
03-17-2008, 03:28 PM
Yes they return the value on the call.

Your answer is a bit short ....
Are you trying to say they return the same result but in different ways, return value respectively out parameter?

If so, I need to go back to my initial question: Is it possible to somehow return the length in seconds without trying to parse the long string returned from this property?

I mean internally there must be a function to calculate the length but it is a pity if it only can be reached in a compiled multistring result ....

Spoon
03-17-2008, 03:39 PM
Only via the string. Another option is to use the [audio info] utility codec (in beta) and export to an excel table of all your files in one go.

jaklithn
03-18-2008, 01:47 AM
Only via the string. Another option is to use the [audio info] utility codec (in beta) and export to an excel table of all your files in one go.

OK, I already did the string parser :)