Converting audio to OGG and MP3's is normally a 2 stage process, first the audio is recorded into a WAV format, then the WAV is then converted into OGG or MP3. Some utilities will do both processes in one go for you.
The format you wish to encode audio from, CD or direct audio, will determine what software tools you need to produce the WAV file.
If you are wanting to encode from audio input, you will need a program that will record from your soundcard's input and save the results in a WAV format. Below are some useful utilities (most of the comments are taken from the respective website of the app.)