Search

Hi, I'm getting my way around symphony which I like very much. I'm a designer with some experience in css and actionscript and I like the way symphony and xslt work.

I'm trying to make a podcast out of a section with mp3 files uploaded. Everything works fine and I'm very satisfied with myself :) but I can't figure out if there is a way to determine the duration of the file in seconds. (btw, i got the length parameter by multiplying the size in mb by 1048576, correct?)

I also wanted to have some sort of autopublish feature based on the date field. Right now I've done it by filtering the data in xslt, comparing the publish date with the current date. Is it the best way to do it or is it possible to obtain similar results right from the DS?

Thank you Please excuse my poor english

Welcome. :)

I also wanted to have some sort of autopublish feature based on the date field.

Yes, this can be done in the DS editor. Add a filter rule for your date field and tell it 1970-01-01 to {$today}. Date fields can accept ranges like this, and the $today param just represents the current date. (To find this, append "?debug" to the end of any front-end URL, then click on the "Params" tab.)

but I can't figure out if there is a way to determine the duration of the file in seconds.

So long as your MP3 is encoded at a fixed bitrate, you should be able to deduce its length. Alternatively, you could add a text input field for the time, e.g. "4:21".

i got the length parameter by multiplying the size in mb by 1048576, correct?

I think you can't find correct duration this way.
Size of mp3 file depends of bitrate(kbps), samplerate(kHz), and encoding algorithms.
Same song with different parameters mentioned above will have different file size.

Just an assumption: maybe you can use some kind of server-side software for this task such as ffmpeg, for example.

That was even easier, symphony is so cool, thanks Scott... now I've have to figure out a way to determine the duration

thanks again... mmh, cool :)

Add a filter rule for your date field and tell it 1970-01-01 to {$today}.

I would suggest you use 1970-01-02 instead as there have been some odd problems as mentioned here: http://bugs.21degrees.com.au/comments.php?DiscussionID=199

Thanks Alistair, it's fine on my computer in Italy (gmt+1) but you never know where the server will be ;)

I'm sure you could create a custom DS that makes use of the of the library at the following site:

http://getid3.org/

A very extensive library that covers most, if not all, popular audio file formats. It returns all meta data in an array, so it would be a pretty simple task to throw it in an XML node-set.

Hope this points you in the right direction.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details