OK. In that case it seems like you’ve not done your Swift 3 conversion properly. Specifically, on line 24 you’re creating an AVAudioRecorder as if you were programming in Swift 2. Swift 3 imports this AVAudioRecorder initialiser as:

init(url: URL, settings: [String : Any]) throws

which means you need to:

Call it with a Swift 3 URL value, rather than the NSURL returned by getFileURL()

Handle any potential error using Swift’s error handling mechanism

The best way to fix the first point is to rewrite lines 27 through 35 to use URL. Here’s how you’d do the equivalent in Swift 3:

More Like This

Incoming Links

This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Developer Forums Participation Agreement.