【问题标题】:Record Settings in Xcode: Swift 2.0Xcode 中的录制设置:Swift 2.0
【发布时间】:2016-02-22 22:46:10
【问题描述】:

这是我在教程中看到的一段 Swift 2.0 代码 (https://youtu.be/4qj1piMAPE0)。我在第一行得到错误:

没有更多内容,表达的类型是模棱两可的。

import AVFoundation
import UIKit
...
var recordSettings = [AVFormatIDKey: kAudioFormatAppleLossless,
        AVEncoderAudioQualityKey: AVAudioQuality.Max.rawValue,
        AVEncoderBitRateKey: 320000,
        AVNumberOfChannelsKey: 2,
        AVSampleRateKey: 44100.0]

【问题讨论】:

    标签: xcode audio swift2 avaudioplayer


    【解决方案1】:

    你可以试试:

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

    【讨论】:

      猜你喜欢
      • 2017-07-01
      • 1970-01-01
      • 2016-09-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-14
      • 1970-01-01
      相关资源
      最近更新 更多