MP3 Player Dengan Ncmpcpp dan MPD

ncmpcpp visualizerSetelah hidup sangat lama dengan OS Linux, penulis sudah banyak memakai mp3 player seperti Rhythmbox yang merupakan bawaan default kebanyakan distribusi Linux, XMMS dan Audacious yang mirip dengan WinAmp di OS Windows, Banshee yang dibangun dengan teknologi Mono ataupun Musique yang relatif baru dll. Semuanya mempunyai kelemahan dan keunggulan masing-masing. Hanya saja penulis membutuhkan mp3 player sederhana tapi powerfull!. Maksudnya MP3 Player yang GUI nya sederhana, ada keyboard shortcut, fleksibel dan dapat dicustom. Nah, akhirnya penulis jatuh cinta pada MPD dan ncmpcpp!! :D . Hmmmm…apaan tu ya??!.

Music Player Daemon atau MPD

MPDMPD merupakan server musik sehingga MPD membutuhkan client untuk memainkan file musik. Client ini bisa secara lokal (desktop) ataupun melalui protokol TCP (HTTP). MPD mendukung Streaming melalui HTTP dan bisa digunakan sebagai input dari shoutcast ataupun icecast!. Untuk lebih jelasnya lihat gambar diagram disamping dan penjelasan dari website MPD.

Install MPD

Pada distro Centos 6 seperti yang saya pakai, MPD dapat di install melalui repositori RPMForge atau melalui repositori ATRpms dengan perintah yum.

$ su -c "yum install mpd"

Setelah terinstall copy file contoh konfigurasi dari MPD ke direktori lokal user dan edit file tersebut

$ cp /usr/share/doc/mpd-0.16.4/mpdconf.example ~/.mpdconf

Berikut contoh file konfigurasi MPD pada komputer penulis

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Equan Pr. 
# Configuration file for MPD
# See the mpd.conf man page for a more detailed description of each parameter.
 
music_directory		"~/Music"
playlist_directory	"~/.mpd/playlists"
db_file			"~/.mpd/database"
log_file		"~/.mpd/log"
pid_file		"~/.mpd/pid"
state_file		"~/.mpd/state"
port			"6600"
log_level		"default"
gapless_mp3_playback	"yes"
auto_update	        "yes"
 
# Audio Output to ALSA
#
audio_output {
	type		"alsa"
	name		"My ALSA Device"
##	device		"hw:0,0"	# optional
##	format		"44100:16:2"	# optional
##	mixer_type      "hardware"	# optional
##	mixer_device	"default"	# optional
##	mixer_control	"PCM"		# optional
##	mixer_index	"0"		# optional
}
 
# Enable Music Visualizer ncmpcpp
audio_output {
       	type            "fifo"
      	name            "My FIFO"
	path            "/tmp/mpd.fifo"
	format          "44100:16:1"
}

Jika parameter playlist_directory, db_file, log_file, pid_file dan state_file belum ada pada sistem anda maka buat terlebih dahulu

$ mkdir ~/.mpd/playlists
$ touch ~/.mpd/database
$ touch ~/.mpd/log
$ touch ~/.mpd/pid
$ touch ~/.mpd/state

Jalankan Music Player Daemon

Untuk menjalankan server MPD bisa dilakukan secara manual atau secara otomatis saat startup. Untuk menjalankan secara manual ketik perintah berikut

$ mpd --no-daemon

Ncmpcpp atau Ncmpc++

Dari sekian banyak klien dari MPD penulis memilih ncmpcpp yang mendukung tag editor, pencarian lagu melalui regular expression, filtering, mendukung last.fm , sort playlist, browsing filesystem lokal, visualisasi bisa dikustom dll. Untuk lebih lengkapnya lihat website ncmpcpp.

Install ncmpcpp

Penulis tidak menemukan paket ncmpcpp dalam repositori Centos 6 shingga harus kompilasi dari source code. Download atau clone kode sumber di repositori git http://repo.or.cz/w/ncmpcpp.git

$ git clone git://repo.or.cz/ncmpcpp.git

Sebelum di compile pastikan library ncurses, curl, taglib dan fftw telah terinstall terlebih dahulu.

$ su -c "yum install ncurses-devel libcurl-devel taglib-devel fftw-devel"

Kemudian compile dan install ncmpcpp dari kode sumber

$ cd ncmpcpp
 
$ ./autogen.sh --prefix=/usr --enable-outputs --enable-visualizer --enable-clock \ 
--with-fftw --with-taglib --with-curl
 
$ make && su -c "make install"
Jalankan Ncmpcpp

Setelah terinstall jalankan Ncmpcpp melalui terminal shell

$ ncmpcpp

Untuk kustomisasi ncmpcpp silahkan anda edit file config dari Ncmpcpp. Berikut screenshot dari Ncmpcpp default pada komputer penulis

Untuk melihat daftar kunci kombinasi keyboard untuk navigasi Ncmpcpp silahkan tekan angka “1″.
ncmpcpp-help


Selamat Mencoba and…
Rock This World!! :D

EMAIL NEWSLETTER

You don't have to check this blog regularly...just sign-up and any post will be send directly to your email ;)

  • http://twitter.com/hawook27 hawook

    Processing video is one thing, but flash makes it in a proprietary, close-source way (AFAIK, correct me if i’m wrong). html5 video playeroffers easy way for web developers to present video or audio. When the HTML4 era ends, there will be no hacks, embed, object and other tags needed, javascript tricks to achieve this in any browser.On the other way, it will be hard for developers of browsers, BUT: it’s still better than having only one close-source technology to have video on site. There is a real concurrency between browsers, so their developers will surely try to make it the best way they can. Unlike Flash developers, in my opinion.