The phone has the arecord and aplay apps. The script found here XMPP: Dino for Librem 5 - #14 by Tonyp could be run to test the microphone input. It should sound the same as when you make a call, if it’s a Librem 5 mic problem.
There is also a graphical recording app available from the Librem 5 app store.