Check if avSession.category is already set to "AVAudioSessionCategoryPlayAndRecord" before recording, so as not to override it with "AVAudioSessionCategoryRecord".