我唯一需要从 mpd 中提取的是当前播放的歌曲/曲目。我必须确保这在输出文件中始终是最新的。
问问题
2440 次
1 回答
6
如果你安装mpc那么你可以执行以下操作:
mpc idle player # block until the player changes songs
mpc current # outputs "Artist Name - Song Name" onto stdout
循环执行这些操作,并将结果输出current
到文件中,就完成了!
#!/bin/sh
while true
do
mpc current > current_song.txt
mpc idle player
done
您可以idle
执行的完整列表在 MPD 命令参考中:http:
//www.musicpd.org/doc/protocol/command_reference.html#status_commands
于 2016-01-20T16:56:34.890 回答