the category of AVAudioSession changed from AVAudioSessionCategoryPlayback to   AVAudioSessionCategoryPlayAndRecord causes abnormal recording audio in iOS13

In iOS13, the category of AVAudioSession is first set to AVAudioSessionCategoryPlayback, and then when recording audio with AVAudioRecorder, the category is set to AVAudioSessionCategoryPlayAndRecord. At this time, the recording will not report a failure. No matter how many seconds I record, the audio file generated is only 4kb, and the length of time to calculate the audio is 0.