I am working on audio recorder app and I use AVAudioRecorder to record audio.
https://www.hackingwithswift.com/example-code/media/how-to-record-audio-using-avaudiorecorde