> I know it is easy to do it with a script but i would like to do it with C
You mean like this?
Henry's Blog: Converting wma to mp3
What do you think programs like 'mplayer' and 'lame' are written in?
Almost certainly, you can get the source code if they're available on Linux.
Almost certainly, they're written in either C or C++.
The rest is just a study exercise on your part to extract the relevant parts of the source code to just accomplish a single task.
And is this you distributing your assignments on different forums?
Retrieve info from wav files - Dev Shed