我正在尝试将本地文件添加到 mpd(通过 mpc)并播放它。我的平台是OpenWRT嵌入式linux。
因此,从手册页来看,它指出:
mpc add <file> Add a song to the current playlist
如果我做:
root@OpenWrt:~/.mpd# mpc add /usr/share/baresip/ring.wav
error adding /usr/share/baresip/ring.wav: directory or file not found
或者如果我这样做:
root@OpenWrt:~/.mpd# mpc add file:///usr/share/baresip/ring.wav
error adding file:///usr/share/baresip/ring.wav: Access denied
这里正确的语法到底是什么? mpc / mpd 的手册页确实不是很清楚。
你的第二次尝试是almost正确的。你遇到的问题是mpd
只会允许file:
通过本地连接传递给它的 URL,它通过要求您连接到它来强制执行unix 域套接字。所以,在你的mpd.conf
你需要有这样一行:
bind_to_address "/run/mpd/socket"
(根据您的系统,您可能想要更改/run
to /var/run
-- 我引用的版本对于最新版本的 debian 或 ubuntu 是正确的,但其他版本可能有所不同)。
然后,您需要设置环境以指向该套接字:
export MPD_HOST=/run/mpd/socket
当你这样做时mpc add
or mpc insert
可以成功接受file:
URL:
$ mpc insert "file:///data/incoming/files/111_scorpions_-_the_zoo.mp3"
$ mpc next
Scorpions - The Zoo
[playing] #23/39 0:00/5:30 (0%)
volume: n/a repeat: off random: off single: off consume: off
$
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)