I want to create a program to convert some music files from wav to mp3. WAV should be raw bitstream and reading it shouldn't be much of a problem, but I don't even know where to start with learning how to encode that raw stream into mp3. I've already read how to build up header of mp3 frame, but I'd like to know how exactly are music data stored. As I;m quite new to this stuff, some thorough reference or tutorial would be great (books are welcomed also).
I'd like to point out that existing libraries and usage of codecs are not an option, so I'll need to go into basics and do it for myself. If you present a code itself, I'm preferring c/c++ but I can somehow read through other languages too.
A complete implementation of an MP3 encoder including (actually, only) source code is LAME: http://sourceforge.net/projects/lame/files/lame/3.99/