Saturday, November 6, 2010

Linux Lessons Part 1 Lesson 3

This lesson is about music. We all struggle with the GUI's to create a playlist.
In this lesson we will see how to create a simple playlist and on next lesson we will make it a little more complicated, so the playlist will have the exact songs we want.
The commands below was executed in linux Ubuntu Ultimate Edition 2.8.
If you have an other distribution of linux you will need to install audacious if you don't have it.
To install it in Ubuntu : sudo apt-get install audacious
In fedora: yum install audacious.
If you can't install it google it.

To create a playlist: check man audacious.
check those parts:






So let's say that:
Our songs are in directories which are in other directories.
All music files are .mp3

we will use the very useful for statement again.
we will use audacious but we will call it in the command line.
first use the command cd and change directory where your music files are.
my is cd $HOME/Music
and then create a list with the songs and load it on audacious like that:

for music in */*/*.mp3; do
playlist+=$music;
done; audacious "$playilist" -E

The first command is for that goes through each directory, and then goes through each another directory which are in the first directory. Then finds all mp3 files and adds them to the variable playlist.
The done closes the for, and then loads the playlist on audacious as a temporary playlist.

Question to consider until Wednesday:
How can you load both mp3 and wma ?

See you on Wednesday.
You can email your answer!

PS: if you can't install audacious try a similar command with the music player you have on your machine after you check its man pages!!!

No comments:

Post a Comment