Hi,
I have a Raspberry Pi Zero with an I2S MEMS Mic that records raw 32bit PCM audio.
I'm using Sox to record raw audio and encode it into mp3:
rec --buffer 2000000 -c 1 -r 44100 -b 32 test.mp3
However, this gives the warning:
/usr/bin/rec WARN formats: mp3 can't encode to 32-bit
And my resulting test.mp3 file has little clicking and popping static noises throughout. I've attached the mp3 file.
I know nothing is wrong with my mic, as I've recorded AAC encoded audio with FFMPEG successfully before. Am I doing something wrong here?
I only hear popping when it initializes the microphone at the start. I see noise, but the only noise I can actually hear is typical line level noise present in a noisy environment.
/usr/bin/rec WARN formats: mp3 can't encode to 32-bit
MP3 doesn't use a bit depth, it simply tries to pack everything as efficient as possible.
Is the popping in the audio (in the file) or is it a artifact of the playback chain?
I only hear popping when it initializes the microphone at the start.
I assume that happens with WAV too? ...Unrelated to MP3 encoding?
A pop/click at the beginning (and end) is usually
DC offset (http://manual.audacityteam.org/man/dc_offset.html) caused by a hardware problem.
There are filters/algorithms to fix offset, or you can apply a high-pass filter (DC is zero-Hz) and a short fade-in (several milliseconds).