(assuming *nix)
mp3 recording is easy
you can record directly (encoding on the fly) just by piping the sound into lame

Code:
something_that_makes_a_sound | lame -x - output.mp3