Hi,
I'm currently using SOX to MP3 encode raw PCM audio. I normally use AAC, but my version of Sox doesn't have AAC support. The MP3's being produced have lots of clicks and popping noises. An example MP3 is attached.
1. Could I expect AAC encoding to produce a cleaner audio file?
2. Is there any way to compile SOX with AAC encoding support?
I can't help you but clicking & popping are not normal MP3 artifacts, so MP3 is not the issue.
P.S.
I'm just guessing because I don't use SoX or and I don't have a Raspberry PI, but if you're trying to record and encode to MP3 at the same time, you might be running out of processing power and/or you might be getting buffer overflows.