MP3, FLAC etc. (MPD):



For music files like MP3 and FLAC we will use MPD, http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki. This is a daemon that can be controlled remotely by a number of different clients. It's included in most major Debian based distro's repositories so all you need to do to install it is open a terminal (shell) on the linux computer and write:



sudo apt-get update && sudo apt-get install mpd



After it has installed we tell it where to look for our music files by editing the configuration file:



sudo nano /etc/mpd.conf



Scroll down to the line "music_directory" and change the path within the parentheses after this line to the path where your music files are, for example:



music_directory "/home/user/Music"



Then scroll down to the line that says



bind_to_address "localhost"



And change it to the ip or host of the computer on the local network, if you don't know what your ip is you can open a new terminal and write:



ifconfig



Look for the line that says "inet addr" followed by something similar to "192.168.0.2". Those are the numbers that you should add instead of "localhost" in the config file:



bind_to_address "192.168.0.2"



Normally this is everything you need to do to get MPD working and the sound output defaults to the default ALSA sound card. If you are using a different sound framework or want to change the sound card you will have to change the "Audio Output" section of the config file yourself (there are too many combinations possible to list them all here), there are examples included in the config file and more information can be found at http://mpd.wikia.com/wiki/Configuration.



After you have edited the config file, close it by pressing "ctrl + x" and choose "y" to save the file. Then restart MPD by writing:



sudo /etc/init.d/mpd restart



Controlling MPD (MPDroid):



To control MPD we will use an Android app called MPDroid. You can search for it on Google Play or use this link: https://play.google.com/store/apps/details?id=com.namelessdev.mpdroid



Install it as normal on your Android device and start it up. Go to the settings dialog and select "WLAN based connection". Choose the network that you are connected to and select "Host". Here you enter the ip address of the Linux computer (same as we entered in the config file above).



Go back to the main settings dialog and tap "Update". After a while the music should show up in the file list.