setOption(array('encoding' => 'UTF-8'));
$info = $getID3->analyze($file);
$total = explode(':', $info['playtime_string']);
$mins = $total[0];
$secs = $total[1];
unset($getID3, $total, $info);
return array(
'PT' . $mins . 'M' . $secs . 'S',
$mins . ' minutes, ' . $secs . ' seconds'
);
}
function audio_get_ogg_object($id) {
$ogg = '';
if (function_exists('shuffle_by_mime_type')):
$oggs =& get_audio($id);
if (is_array($oggs) && count($oggs) > 0) {
foreach ($oggs as $o):
if ($o->post_mime_type === 'audio/ogg') {
$ogg = $o;
break;
}
endforeach;
}
unset($oggs);
endif;
return $ogg;
}
function audio_image($id, $title) {
if (function_exists('shuffle_by_mime_type')):
$imgs = get_images($id);
if (count($imgs)):
foreach ($imgs as $img):
$meta = wp_get_attachment_image_src($img->ID, array(A_THUMB_WIDTH, A_THUMB_HEIGHT), true);
printf('',
$meta[0], $meta[1], $meta[2], apply_filters('the_title_attribute', $title));
endforeach;
endif;
unset($imgs);
endif;
}
function audio_enclosure($mime, $path, $song) {
printf('"%s"', $mime, base64_encode($path), $song);
}
function audio_item_formatted($post) {
$song = apply_filters('the_title', $post->post_title);
$artist = $post->post_excerpt;
$album = $post->post_content;
$parts = parse_url($post->guid);
$local_file = getcwd() . $parts['path'];
?>