我使用以下脚本生成播放列表:
<?php
$dir = './music';
$url = 'music';
header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
echo '<playlist>';
if (is_dir($dir)) {
$dp = opendir($dir);
while (false !== ($file = readdir($dp))){
if ('mp3'==strtolower(substr($file, -3))) {
printf('<sound src="%s/%s" stream="true" soundbuffer="8">%s</sound>', $url, $file, str_replace('_', ' ', substr($file, 0, -4)));
echo "\n";
}
}
closedir($dp);
}
echo '</playlist>';
如何从每个mp3文件中获取艺术家和长度?
提前致谢
答案 0 :(得分:1)
答案 1 :(得分:0)
答案 2 :(得分:0)
答案 3 :(得分:0)
您也可以在此处使用此功能来读取mp3 id3标签:
http://www.barattalo.it/2010/02/22/reading-mp3-informations-with-php-id3-tags/