Index: filefield_meta.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/filefield/filefield_meta/filefield_meta.install,v
retrieving revision 1.4
diff -u -r1.4 filefield_meta.install
--- filefield_meta.install	31 Jul 2008 01:02:15 -0000	1.4
+++ filefield_meta.install	19 Nov 2008 19:43:07 -0000
@@ -48,9 +48,84 @@
         'size' => 'normal',
         'not null' => FALSE,
       ),
+      'audio_format' => array(
+        'description' => t('The audio format.'),
+        'type' => 'varchar',
+        'length' => 10,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'audio_sample_rate' => array(
+        'description' => t('The sample rate of the audio.'),
+        'type' => 'int',
+        'size' => 'medium',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'audio_channel_mode' => array(
+        'description' => t('The number of channels in the audio, by name.'),
+        'type' => 'varchar',
+        'length' => 10,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'audio_bitrate' => array(
+        'description' => t('The audio bitrate.'),
+        'type' => 'float',
+        'size' => 'medium',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'audio_bitrate_mode' => array(
+        'description' => t('The kind of audio bitrate.'),
+        'type' => 'varchar',
+        'length' => 4,
+        'not null' => TRUE,
+        'default' => '',
+      ),
     ),
     'primary key' => array('fid'),
   );
 
   return $schema;
 }
+
+function filefield_meta_update_1() {
+  $ret = array();
+  db_add_field($ret, 'filefield_meta', 'audio_format', array(
+    'description' => t('The audio format.'),
+    'type' => 'varchar',
+    'length' => 10,
+    'not null' => TRUE,
+    'default' => '',
+  ));
+  db_add_field($ret, 'filefield_meta', 'audio_sample_rate', array(
+    'description' => t('The sample rate of the audio.'),
+    'type' => 'int',
+    'size' => 'medium',
+    'not null' => TRUE,
+    'default' => 0,
+  ));
+  db_add_field($ret, 'filefield_meta', 'audio_channel_mode', array(
+    'description' => t('The number of channels in the audio, by name.'),
+    'type' => 'varchar',
+    'length' => 10,
+    'not null' => TRUE,
+    'default' => '',
+  ));
+  db_add_field($ret, 'filefield_meta', 'audio_bitrate', array(
+    'description' => t('The audio bitrate.'),
+    'type' => 'float',
+    'size' => 'medium',
+    'not null' => TRUE,
+    'default' => 0,
+  ));
+  db_add_field($ret, 'filefield_meta', 'audio_bitrate_mode', array(
+    'description' => t('The kind of audio bitrate.'),
+    'type' => 'varchar',
+    'length' => 4,
+    'not null' => TRUE,
+    'default' => '',
+  ));
+  return $ret;
+}
\ No newline at end of file
Index: filefield_meta.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/filefield/filefield_meta/filefield_meta.module,v
retrieving revision 1.6
diff -u -r1.6 filefield_meta.module
--- filefield_meta.module	10 Oct 2008 01:03:09 -0000	1.6
+++ filefield_meta.module	19 Nov 2008 19:43:07 -0000
@@ -10,6 +10,12 @@
     'filefield_meta_duration' => array(
       'arguments' => array('duration' => NULL),
     ),
+    'filefield_meta_samplerate' => array(
+      'arguments' => array('samplerate' => NULL),
+    ),
+    'filefield_meta_bitrate' => array(
+      'arguments' => array('bitrate' => NULL),
+    ),
   );
 }
 
@@ -63,6 +69,11 @@
     }
   }
   $file->data['duration'] = $info['playtime_seconds'];
+  $file->data['audio_format'] = $info['audio']['dataformat']; //e.g. mp3
+  $file->data['audio_sample_rate'] = $info['audio']['sample_rate']; //e.g. 44100
+  $file->data['audio_channel_mode'] = $info['audio']['channelmode']; // e.g. mono
+  $file->data['audio_bitrate'] = $info['audio']['bitrate']; //e.g. 64000
+  $file->data['audio_bitrate_mode'] = $info['audio']['bitrate_mode']; //e.g. cbr
 };
 
 /**
@@ -79,3 +90,17 @@
   }
   return intval($minutes).':'.str_pad($seconds, 2, 0, STR_PAD_LEFT);
 }
+
+/**
+ * Formats audio sample rate.
+ */
+function theme_filefield_meta_samplerate($samplerate) {
+  return sprintf("%.1f kHz", $samplerate/1000);
+}
+
+/**
+ * Formats audio bit rate.
+ */
+function theme_filefield_meta_bitrate($bitrate) {
+  return sprintf("%d Kbps", $bitrate/1000);
+}
