I have upgraded to Swift 2.0 and I quite can't understand this when I try to record a sound:
Type of expression is ambiguous without more context
on var recordSettings
What should I do to fixt this error and more important, why?
var recordSettings = [
AVFormatIDKey: kAudioFormatAppleLossless,
AVEncoderAudioQualityKey : AVAudioQuality.Max.rawValue,
AVEncoderBitRateKey : 320000,
AVNumberOfChannelsKey: 2,
AVSampleRateKey : 44100.0
]
var dirPaths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)
var docsDir: AnyObject = dirPaths[0]
var soundFilePath = docsDir.stringByAppendingPathComponent("tempRecordzz")
var soundFileURL:NSURL = NSURL(fileURLWithPath: soundFilePath)
var error: NSError?
do {
recorder = try AVAudioRecorder(URL: soundFileURL, settings: recordSettings)
} catch var error1 as NSError {
error = error1
recorder = nil
}