Ich habe ein Upgrade auf Swift 2.0 mehrdeutig ist, und ich kann nicht ganz verstehen, wenn ich versuche, einen Ton zu notieren:Wie Art des Ausdrucks zu lösen, ohne mehr Kontext für einen Audio-Recorder in schnellen 2
Typen Ausdruck ist ohne mehr Kontext
auf var recordSettings
mehrdeutig Was kann ich tun, um diesen Fehler fixe und noch wichtiger ist, warum?
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
}
Perfect. Vielen Dank! –
Ich würde dir eine Umarmung geben: D .... Vielen Dank – Husam
'kAudioFormatAppleLossless' ist' UInt32' ab Xcode7.0.1. – rintaro