metadata_to_use "artist,album,title,name"
完成此操作后,我重新启动了 Icecast2 和 MPD,但在 status-json.xsl 文件上,没有其他可用标签。
我认为标签在需要时会作为附加信息出现在 status-json.xsl 文件上,但我显然错了。
就元数据而言,我在 Icecast2 部分没有找到任何相关属性。
有人可以澄清我应该在哪里找到我需要的附加标签吗?
或者,如果我配置错误,我应该寻找什么?
非常感谢!
好吧,长话短说,没有办法。
在 Interweb 上阅读后,我发现 mpd 带有自己的 httpd 服务器,事实上,在使其工作后,根本就不再需要 Icecast2 了。
对于那些对如何管理感兴趣的人,这里是:
mpd.conf:
"gapless "yes"
:audio_output{}
(Shout 那个)audio_output{}
输入“httpd”,encoder "vorbis"
,因为就元数据而言,Lame 不适合我,always_on "yes"
tags "yes"
<!DOCTYPE html>
<html>
<body>
<?php
function get_string_between($string, $start, $end)
{
$string = ' ' . $string;
$ini = strpos($string, $start);
if ($ini == 0) return false;
$ini += strlen($start);
$len = strpos($string, $end, $ini) - $ini;
return substr($string, $ini, $len);
}
$fp = fsockopen("192.168.1.10",8100,$errno,$errstr,1);
if (!$fp)
{
echo "$errstr ($errno)<br />\n";
}
else
{
$out = "GET / HTTP/1.1\r\n";
$out .= "Host: www.example.com\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
$stop=false;
$album='';
$artist='';
$title='';
while(!$stop)
{
if(feof($fp)) $stop=true;
$buff=fgets($fp, 512);
$album=get_string_between($buff,'ALBUM=','vorbis+');
if($album!=false) $stop=true;
$title=get_string_between($buff,'TITLE=','ALBUM=');
if($title!=false) $stop=true;
$artist=get_string_between($buff,'ARTIST=','TITLE=');
if($artist!=false) $stop=true;
}
if($album==false) $album='n/a';
if($title==false) $title='n/a';
if($artist==false) $artist='n/a';
fclose($fp);
echo("<table><tr><td align=center><b>$artist</b> - $title</td></tr>");
echo("<tr><td align=center><i>$album</i></td></tr></table>");
}
?>
</body>
</html>
诚然,这是初稿,尽管它工作得并不完美,但它确实对我有用,所以我希望它对其他人有帮助!
可能不错,但是这个代码应该放在哪里?