linux 上的 mpc/mpd:如何播放本地 wav 文件 [英] mpc / mpd on linux: how to play local wav file
问题描述
我正在尝试将本地文件添加到 mpd(通过 mpc)并播放.我的平台是 OpenWRT 嵌入式 linux.
I am trying to add a local file to mpd ( through mpc ) and play it . my platform is OpenWRT embedded linux .
因此,从手册页中,它指出:
so, from the man page, it states:
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 的手册页真的不是很清楚.
what exactly is the correct syntax here? the man page is really not very clear for mpc / mpd .
推荐答案
我没有找到如何播放 wav..but 我忘了我找到了解决方案(用于 mp3)并将其发布在这里:https://forum.openwrt.org/viewtopic.php?id=41022
i did not find out how to play wav..but i forgot i found the solution (for mp3) and posted it here: https://forum.openwrt.org/viewtopic.php?id=41022
但是,由于stackoverflow总是出现在谷歌搜索的顶部,我在这里粘贴相同的解决方案,以防万一它也有助于某人:
however, since stackoverflow always shows up top on google search i am pasting the same solution here in case it helps someone as well :
/etc/mpd.conf 应该是这样的:
/etc/mpd.conf should be something approximately like this:
music_directory "/tmp"
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/database"
log_file "/tmp/mpdlog"
pid_file "~/.mpd/pid"
state_file "~/.mpd/state"
sticker_file "~/.mpd/sticker.sql"
user "root"
group "root"
bind_to_address "127.0.0.1"
log_level "verbose"
auto_update "yes"
auto_update_depth "3"
follow_outside_symlinks "yes"
follow_inside_symlinks "yes"
然后:
- /etc/init.d/mpd 重启
- 将 MP3(wav 似乎不起作用)文件复制到/tmp 文件夹(因为音乐目录是/tmp 文件夹)
- mpc 更新
- mpc add file.mp3(添加/tmp/file.mp3 不起作用)
- mpc 播放
这篇关于linux 上的 mpc/mpd:如何播放本地 wav 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!