Swift 2.0: Type of Expression is ambiguous without more context?

后端 未结 3 439
说谎
说谎 2020-12-30 20:32

The following used to work in Swift 1.2:

var recordSettings = [
    AVFormatIDKey: kAudioFormatMPEG4AAC,
    AVEncoderAudioQualityKey : AVAudioQuality.Max.ra         


        
3条回答
  •  旧巷少年郎
    2020-12-30 21:06

    You could give the compiler more information:

    let recordSettings : [String : Any] =
    [
        AVFormatIDKey: kAudioFormatMPEG4AAC,
        AVEncoderAudioQualityKey : AVAudioQuality.Max.rawValue,
        AVEncoderBitRateKey : 320000,
        AVNumberOfChannelsKey: 2,
        AVSampleRateKey : 44100.0
    ]
    

提交回复
热议问题