AVFoundation and request of microphone

Viewed 176

I have a problem about the AVFoundation

import AVFoundation

override func viewDidLoad() {
    super.viewDidLoad()  
    setUpAudio()
}

func setUpAudio() {

    do {
        playCorrect = try AVAudioPlayer(contentsOf: URL.init(fileURLWithPath: Bundle.main.path(forResource: "correct", ofType: "mp3")!))
        playCorrect.prepareToPlay()
    }
    catch {
        print(error)
    }

}

When launching the app, it appears

enter image description here

I don't know which line of code trigger the request of microphone.

My app doesn't need access of microphone. How can I make the request box disappear??

I have tried "DON'T ALLOW" the request, and my app worked fine.

0 Answers
Related