情景:
- Ubuntu 17.04
- apt-get
安装的Liquid Soap 1.1.1- OPAM安装的Liquid Soap 1.3.1
在1.1.1上,我不能使用AAC +编码器。所以我已经安装了1.3.1 AAC +支持。但是使用相同的.liq文件,两个版本的行为都不同。
由于某种原因,1.1工作,1.3不工作:
def my_request_function() =
# Get the first line of my external process
result = list.hd(get_process_lines("php -q liquid.php"))
# Create and return a request using this result
request.create(result)
end
错误:
At line 17, char 24:
this value has type
(default:_)->_ (inferred at line 15, char 19-58)
but it should be a subtype of
string
我想读下"下一首歌"来自PHP脚本。在1.1.1上使用MP3(+ icecast2),但由于我需要AAC +,我使用的是1.3.1,我无法弄清楚如何阅读外部脚本。
有什么想法吗?谢谢。
答案 0 :(得分:2)
1.3在list.hd
和其他列表函数中添加了另一个参数。
https://github.com/savonet/liquidsoap/blob/master/CHANGES#L52
您可以使用新的默认值参数更新代码,它应该可以正常工作。
result = list.hd(default="", get_process_lines("php -q liquid.php"))