Mpd configuration: Difference between revisions

From wikinotes
(Created page with "= mpd.conf = <blockquote> <source lang="bash"> # ~/.mpdconf music_directory "/home/media/music" db_file "/home/media/.mpd/db" log_file "/home/media/.mpd/log"...")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
= mpd.conf =
= mpd.conf =
<blockquote>
<blockquote>
Line 12: Line 13:
user            "mpd"
user            "mpd"
</source>
</source>
</blockquote><!-- mpd.conf -->


== Audio Output ==
== Output Plugins ==
<blockquote>
Configures what happens when the music is played.
 
=== PulseAudio ===
<blockquote>
<blockquote>
<syntaxhighlight lang="bash">
audio_output {
  type "pulse"
  name "pulseaudio"
}
</syntaxhighlight>
</blockquote><!-- PulseAudio -->
=== HTTPD Streaming ===
=== HTTPD Streaming ===
<source lang="bash">
<blockquote>
# Streaming Output
{{ NOTE |
#
This only supports one client at a time, and it has issues with switching songs.<br>
# this is copied verbatim from /usr/share/doc/mpd/mpdconf.example
The archwiki proposes an alternate setup that may be worth a try: https://wiki.archlinux.org/title/Music_Player_Daemon/Tips_and_tricks#Music_streaming_with_the_satellite_setup
}}
You can stream music over http, and listen to it with a music player like VLC.<br>
See [https://mpd.readthedocs.io/en/latest/plugins.html#httpd documentation]
 
<syntaxhighlight lang="bash">
# copied verbatim from /usr/share/doc/mpd/mpdconf.example


audio_output {
audio_output {
     type              "httpd"
     type              "httpd"
     name              "My HTTP Stream"
     name              "My HTTP Stream"
     encoder            "vorbis"         # optional, vorbis or lame
     encoder            "vorbis"         # flac, vorbis, lame..
     port              "8000"
     port              "8000"
     bind_to_address    "0.0.0.0"        # optional, IPv4 or IPv6
     bind_to_address    "0.0.0.0"        # optional, IPv4 or IPv6
Line 33: Line 51:
     max_clients        "0"            # optional 0=no limit
     max_clients        "0"            # optional 0=no limit
}
}
</source>
</syntaxhighlight>


Listen to Stream
Listen to Stream
Line 43: Line 61:
http://foo.com/mpd.ogg
http://foo.com/mpd.ogg
</source>
</source>
</blockquote><!-- audio output -->
</blockquote><!-- HTTPD Streaming -->
</blockquote><!-- Output Plugins -->
</blockquote><!-- mpd.conf -->

Latest revision as of 15:47, 16 April 2022

mpd.conf

# ~/.mpdconf

music_directory "/home/media/music"

db_file         "/home/media/.mpd/db"
log_file        "/home/media/.mpd/log"
pid_file        "/home/media/.mpd/pid"
state_file      "/home/media/.mpd/state"
user            "mpd"

Output Plugins

Configures what happens when the music is played.

PulseAudio

audio_output {
  type "pulse"
  name "pulseaudio"
}

HTTPD Streaming

NOTE:

This only supports one client at a time, and it has issues with switching songs.
The archwiki proposes an alternate setup that may be worth a try: https://wiki.archlinux.org/title/Music_Player_Daemon/Tips_and_tricks#Music_streaming_with_the_satellite_setup

You can stream music over http, and listen to it with a music player like VLC.
See documentation

# copied verbatim from /usr/share/doc/mpd/mpdconf.example

audio_output {
    type               "httpd"
    name               "My HTTP Stream"
    encoder            "vorbis"         # flac, vorbis, lame..
    port               "8000"
    bind_to_address    "0.0.0.0"        # optional, IPv4 or IPv6
#   quality           "5.0"             # do not define if bitrate is defined
    bitrate            "128"            # do not define if quality is defined
    format             "44100:16:1"
    max_clients        "0"            # optional 0=no limit
}

Listen to Stream

# adds 'track' representing stream
mpc add http://foo.com:8000

# alternatively, use vlc
http://foo.com/mpd.ogg