Swift3 Microphone Audio Input - play without record
问题 I am trying to play microphone audio input using swift3 without recording. I can record the audio with the following code: let session = AVAudioSession.sharedInstance() try! session.setCategory(AVAudioSessionCategoryPlayAndRecord, with:AVAudioSessionCategoryOptions.defaultToSpeaker) try! audioRecorder = AVAudioRecorder(url: filePath!, settings: [:]) audioRecorder.delegate = self audioRecorder.isMeteringEnabled = true audioRecorder.prepareToRecord() audioRecorder.record() and then play it back