Shrouk Hasan Khan Shrouk Hasan Khan - 1 year ago 370
Linux Question

mpc / mpd on linux: how to play local wav file

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

if i do:

root@OpenWrt:~/.mpd# mpc add /usr/share/baresip/ring.wav
error adding /usr/share/baresip/ring.wav: directory or file not found

or if i do:

root@OpenWrt:~/.mpd# mpc add file:///usr/share/baresip/ring.wav
error adding file:///usr/share/baresip/ring.wav: Access denied

what exactly is the correct syntax here? the man page is really not very clear for mpc / mpd .

Answer Source

i did not find out how to play wav..but i forgot i found the solution (for mp3) and posted it here:

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 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 ""

log_level            "verbose"
auto_update    "yes"
auto_update_depth "3"
follow_outside_symlinks    "yes"
follow_inside_symlinks        "yes"

and then:

  1. /etc/init.d/mpd restart
  2. copy MP3 ( wav does not seem to work ) file to /tmp folder ( because music directory is the /tmp folder )
  3. mpc update
  4. mpc add file.mp3 ( adding /tmp/file.mp3 will NOT work )
  5. mpc play