Last updated September 7, 2013. Created by GrahamO on September 3, 2013.
Log in to edit this page.

To do this in Drupal 7 first install two modules : getID3() and Computed Field.

In the content type that holds the details for each audio track add a field of type 'Computed'
For this field, in the entry 'Computed Field (PHP)' insert the following code:

$node = menu_get_object();
//this is to be a new node so get audio file uri from
//most recent entry in Drupal's file_managed table
$name2=db_query_range('SELECT uri FROM {file_managed} ORDER BY fid DESC',0,1)->fetchField();
//this is an existing node being edited so get audio file uri
//for this node from Drupal's node table
$thisname = field_get_items('node', $node, 'field_audiofile');
$entity_field[0]['value'] = $playtime;

where 'field_audiofile' is the machine name of the field used for the file path of each track
In this case '$playtime' uses PHP code to give the duration of the track in minutes

Looking for support? Visit the forums, or join #drupal-support in IRC.