Anyone who uses Linux knows how dazzling and rich mplayer is. Mplayer can easily surpass any other player in the world (except maybe vlc). With a little bit of scripting 'mplayer' easily changes to some what 'magic-player'.This script gives you the advantage of adding and choosing equalizer presets in mplayer.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
HOW THIS SCRIPT WORKS:
mplayer has it's configuration file in .mplayer/config in your home folder and the script simply paste equalizer preset of the genre you choose.
Presets are obtained from vlc mplayer. vlc has maximum 20 dB for a particular frequency, while mplayer has 12 dB. The difference has been proportionately adjusted in this script.
----------------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------
#!/bin/bash
#for changing equalizer preset in mplayer
echo -e "1. flat\n2. classical\n3. club\n4. dance\n5. full-bass\n6. full-bass-and-treble\n7. full-treble\n8. headphones\n9. large-hall\n10.live\n11.party\n12.pop\n13.reggae\n14.rock\n15.ska\n16.soft\n17.soft-rock\n18.techno\n"
read -p "your choice:"
case $REPLY in
1)echo "af=equalizer=0.0:0.0:0.0:0.0:0.0:0.0:0.0:0.0:0.0:0.0 #flat" > /home/$USER/.mplayer/config
;;
2)echo "af=equalizer=0.0:0.0:0.0:0.0:0.0:-4.4:-4.4:-4.4:-5.8 #classical" > /home/$USER/.mplayer/config
;;
3)echo "af=equalizer=0.0:0.0:4.8:3.3:3.3:3.3:1.9:0.0:0.0 #club" > /home/$USER/.mplayer/config
;;
4)echo "af=equalizer=5.7:4.3:1.4:0.0:0.0:-3.4:-4.4:-4.3:0.0:0.0 #dance" > /home/$USER/.mplayer/config
;;
5)echo "af=equalizer=-4.8:5.7:5.7:3.3:1.0:-2.4:-4.8:-6.3:-6.7:-6.7 #full bass" > /home/$USER/.mplayer/config
;;
6)echo "af=equalizer=4.3:3.3:0.0:-4.4:-2.9:1.0:4.8:6.7:7.2:7.2 #full bass and treble" > /home/$USER/.mplayer/config
;;
7)echo "af=equalizer=-5.8:-5.8:-5.8:-2.4:1.4:6.7:9.6:9.6:9.6:10.1 #full treble" > /home/$USER/.mplayer/config
;;
8)echo "af=equalizer=2.8:6.7:3.3:-2.0:-1.4:1.0:2.8:5.7:7.7:8.6 #headphones" > /home/$USER/.mplayer/config
;;
9)echo "af=equalizer=6.2:6.2:3.3:3.3:0.0:-2.9:-2.9:-2.9:0.0:0.0 #large hall" > /home/$USER/.mplayer/config
;;
10)echo "af=equalizer=-2.9:0.0:2.4:3.3:3.3:3.3:2.4:1.4:1.4:1.4 #live" > /home/$USER/.mplayer/config
;;
11)echo "af=equalizer=4.3:4.3:0.0:0.0:0.0:0.0:0.0:0.0:4.3:4.3 #party" > /home/$USER/.mplayer/config
;;
12)echo "af=equalizer=-1.0:2.8:4.3:4.8:3.3:0.0:-1.4:-1.4:-1.0:-1.0 #pop" > /home/$USER/.mplayer/config
;;
13)echo "af=equalizer=0.0:0.0:0.0:-3.4:0.0:3.8:3.8:0.0:0.0:0.0 #reggae" > /home/$USER/.mplayer/config
;;
14)echo "af=equalizer=4.8:2.8:-3.4:-4.8:-2.0:2.4:5.3:6.7:6.7:6.7 #rock" > /home/$USER/.mplayer/config
;;
15)echo "af=equalizer=-1.4:-2.9:-2.4:0.0:2.4:3.3:5.3:5.7:6.7:5.8 #ska" > /home/$USER/.mplayer/config
;;
16)echo "af=equalizer=2.8:1.0:0.0:-1.4:0.0:2.4:4.8:5.7:6.7:7.2 #soft" > /home/$USER/.mplayer/config
;;
17)echo "af=equalizer=2.4:2.4:1.4:0.0:-2.4:-3.4:-2.0:0.0:1.4:5.3 #soft rock" > /home/$USER/.mplayer/config
;;
18)echo "af=equalizer=4.8:3.3:0.0:-3.4:-2.9:0.0:4.8:5.7:5.8:5.3 #techno" > /home/$USER/.mplayer/config
;;
esac
-------------------------------------------------------------------------------------------
When the script is executed it will display available presents. Type the number along the genre and press enter to make the change i.e if I want 'dance' type '4' and just press enter.
Please note that the script assumes that you have no other setting in your mplayer configuration file (default case).Also if you change preset while mplayer is still playing the change will take effect only after restarting mplayer.
Enjoy Linux!!
Don't know what to do with these codes ?? click here
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
HOW THIS SCRIPT WORKS:
mplayer has it's configuration file in .mplayer/config in your home folder and the script simply paste equalizer preset of the genre you choose.
Presets are obtained from vlc mplayer. vlc has maximum 20 dB for a particular frequency, while mplayer has 12 dB. The difference has been proportionately adjusted in this script.
----------------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------
#!/bin/bash
#for changing equalizer preset in mplayer
echo -e "1. flat\n2. classical\n3. club\n4. dance\n5. full-bass\n6. full-bass-and-treble\n7. full-treble\n8. headphones\n9. large-hall\n10.live\n11.party\n12.pop\n13.reggae\n14.rock\n15.ska\n16.soft\n17.soft-rock\n18.techno\n"
read -p "your choice:"
case $REPLY in
1)echo "af=equalizer=0.0:0.0:0.0:0.0:0.0:0.0:0.0:0.0:0.0:0.0 #flat" > /home/$USER/.mplayer/config
;;
2)echo "af=equalizer=0.0:0.0:0.0:0.0:0.0:-4.4:-4.4:-4.4:-5.8 #classical" > /home/$USER/.mplayer/config
;;
3)echo "af=equalizer=0.0:0.0:4.8:3.3:3.3:3.3:1.9:0.0:0.0 #club" > /home/$USER/.mplayer/config
;;
4)echo "af=equalizer=5.7:4.3:1.4:0.0:0.0:-3.4:-4.4:-4.3:0.0:0.0 #dance" > /home/$USER/.mplayer/config
;;
5)echo "af=equalizer=-4.8:5.7:5.7:3.3:1.0:-2.4:-4.8:-6.3:-6.7:-6.7 #full bass" > /home/$USER/.mplayer/config
;;
6)echo "af=equalizer=4.3:3.3:0.0:-4.4:-2.9:1.0:4.8:6.7:7.2:7.2 #full bass and treble" > /home/$USER/.mplayer/config
;;
7)echo "af=equalizer=-5.8:-5.8:-5.8:-2.4:1.4:6.7:9.6:9.6:9.6:10.1 #full treble" > /home/$USER/.mplayer/config
;;
8)echo "af=equalizer=2.8:6.7:3.3:-2.0:-1.4:1.0:2.8:5.7:7.7:8.6 #headphones" > /home/$USER/.mplayer/config
;;
9)echo "af=equalizer=6.2:6.2:3.3:3.3:0.0:-2.9:-2.9:-2.9:0.0:0.0 #large hall" > /home/$USER/.mplayer/config
;;
10)echo "af=equalizer=-2.9:0.0:2.4:3.3:3.3:3.3:2.4:1.4:1.4:1.4 #live" > /home/$USER/.mplayer/config
;;
11)echo "af=equalizer=4.3:4.3:0.0:0.0:0.0:0.0:0.0:0.0:4.3:4.3 #party" > /home/$USER/.mplayer/config
;;
12)echo "af=equalizer=-1.0:2.8:4.3:4.8:3.3:0.0:-1.4:-1.4:-1.0:-1.0 #pop" > /home/$USER/.mplayer/config
;;
13)echo "af=equalizer=0.0:0.0:0.0:-3.4:0.0:3.8:3.8:0.0:0.0:0.0 #reggae" > /home/$USER/.mplayer/config
;;
14)echo "af=equalizer=4.8:2.8:-3.4:-4.8:-2.0:2.4:5.3:6.7:6.7:6.7 #rock" > /home/$USER/.mplayer/config
;;
15)echo "af=equalizer=-1.4:-2.9:-2.4:0.0:2.4:3.3:5.3:5.7:6.7:5.8 #ska" > /home/$USER/.mplayer/config
;;
16)echo "af=equalizer=2.8:1.0:0.0:-1.4:0.0:2.4:4.8:5.7:6.7:7.2 #soft" > /home/$USER/.mplayer/config
;;
17)echo "af=equalizer=2.4:2.4:1.4:0.0:-2.4:-3.4:-2.0:0.0:1.4:5.3 #soft rock" > /home/$USER/.mplayer/config
;;
18)echo "af=equalizer=4.8:3.3:0.0:-3.4:-2.9:0.0:4.8:5.7:5.8:5.3 #techno" > /home/$USER/.mplayer/config
;;
esac
-------------------------------------------------------------------------------------------
When the script is executed it will display available presents. Type the number along the genre and press enter to make the change i.e if I want 'dance' type '4' and just press enter.
Please note that the script assumes that you have no other setting in your mplayer configuration file (default case).Also if you change preset while mplayer is still playing the change will take effect only after restarting mplayer.
Enjoy Linux!!
Don't know what to do with these codes ?? click here