You are here

function audiofield_getid3_analyze in AudioField 7

Get getid3_analyze.

1 call to audiofield_getid3_analyze()
audiofield_details_formatter in ./audiofield.module
Get details formater.

File

./audiofield.module, line 111
Audio Field module for displaying audio files as usable players.

Code

function audiofield_getid3_analyze($audio_path) {
  if (audiofield_accessible_getid3()) {
    if (!class_exists('getid3')) {
      drupal_set_message(t('Missing class getid3! Check getid3 module installation.'), 'error', FALSE);
      return FALSE;
    }
    else {
      $file_path = drupal_realpath($audio_path);
      $getID3 = getid3_instance();
      if (!file_exists($file_path)) {
        return array();
      }
      return $getID3
        ->analyze($file_path);
    }
  }
  return FALSE;
}