Some feedback: I tested your application on Linux Intel (x86_64). Linux mint (19.x and 20.x vanilla). SDL 2.0.12 (custom build)
Player : works as expected. I tested with my own testAudio.aac (the one in the repo is probably broken, or something like that)
Recorder : works very well (really). I event tested bit_rate = 96000 and it is even better !
N.B. : to switch between player and recorder, I just renamed main() in main1() and vice versa.
FYI, I had a long time to figure out what happens with audio sources + SDL. change default for pulse or hw:1,0, or whatever does not help. The only important thing is that you'll have to consider, is that the source MUST be selected in Linux system, means using the Sound plugin from the Gnome Control Center.
Other sources can be used, and ONLY ONE can be used for recording (mute other is not a bad idea)
I'd suggest to keep this issue open to add other feedbacks.
Thank you !