ffmpegなら -fflags +discardcorrupt と -bsf:a aac_adtstoasc をくっつけてm4aで録音してるよ