Level 13
You are going to want to look into WebRTC / get user media and the recording API.
-
https://webrtc.github.io/samples/ -
https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia -
https://developer.mozilla.org/en-US/docs/Web/API/MediaStream_Recording_API
You can peak at my older one that is a bit jank, but works XD
https://github.com/RTippin/messenger-ui/blob/master/resources/js/modules/RecordAudio.js