Friday, October 11, 2013

How to avoid increasing and decreasing the volume of songs when you are listening to different music tracks.

If you are a music fan, you would have definitely faced an issue where some songs are too loud and when you decrease the volume...voila! The next song volume is too low.

How do you avoid the small (but really irritating) task of increasing and decreasing the volume?

Solution: Normalization to the rescue!

Right click on sound icon on the task bar.
Click "Playback devices".
Select "Speakers".
Right click on "Speakers" and click on "Properties".
You will see four tabs a. General b. Levels c. Enhancements d. Advanced
Click on "Enhancement" tab.
You will see four types of enhancements a. Bass Boost. b. Virtual surround c. Room correction d. Loudness Equalization.
Click on "Loudness Equalization" to select it.
Click on Ok.

You are done!! Now try playing two music files recorded at different amplitudes. You will find that both play at the same loudness. Problem solved!

Next question: You want to play these music files on a device (eg: mp3 player) which does not have the normalization feature available in Windows. How do you go about it?

Solution: Use the free utility "MP3Gain" to modify all your music files. Now you can play all your music files on any device at the same volume!!

Don't believe such an utility exists? Here is the screenshot for proof. In addition to being free, it is opensource as well. So now you can dig into the code and see how they coded the damn thing as well!

Friday, August 16, 2013

Using simple methods for data extraction

Here is a simple problem

IMDB publishes movies of all time. The list contains 250 movies.

Problem: In the web page, there is no sorting based on rating or votes.

Goal: I want to sort it by year, so that I can watch movies from latest to the old ones. And year is not a field at all in their table.
It will be good to have sorting by votes,rating as well.

How to go about it?

We can use very simple methods to achieve the solution instead of writing a full fledged program.


The first step is to copy the data into excel and separate it out into columns. (Excel can separate it out into columns if we copy the data into a text file and use the import operator.)

But there are problems with importing into excel. The two broad types of import are "fixed width" and "delimiter".

The length of the movie name is not fixed. So we cannot use fixed width column import.
We cannot use space as delimiter. Since movie names contain space.

Alternate Solution

I first use the left bracket "( "as the delimiter and get retrieve data.
Then I use the right bracket ")" and retrieve  data. This is because excel does not provide option for two custom delimiters.
Hence the two step process.

Once I have separated out the date and votes like this, i move them to a separate text file.

Now i come back to the original file (which just contains Rank, Rating and Title) and use fixed delimiter to separate out the Rank and Rating. What remains is the "movie title" neatly separated out into its own column.

So we have reached the solution by using a combination of custom delimiter and fixed width in Excel.

I can sort by ID, Rating, Title, Year or Votes. :)

And here is the link to the excl file i created using the above steps.