[英]Record Settings in Xcode: Swift 2.0
這是我在教程( https://youtu.be/4qj1piMAPE0 )中看到的Swift 2.0代碼。 我在第一行得到錯誤:
表達式類型不明確,沒有更多內容。
import AVFoundation
import UIKit
...
var recordSettings = [AVFormatIDKey: kAudioFormatAppleLossless,
AVEncoderAudioQualityKey: AVAudioQuality.Max.rawValue,
AVEncoderBitRateKey: 320000,
AVNumberOfChannelsKey: 2,
AVSampleRateKey: 44100.0]
你可以試試:
var recordSettings : [String : Any] =
[
AVFormatIDKey: kAudioFormatMPEG4AAC,
AVEncoderAudioQualityKey : AVAudioQuality.Max.rawValue,
AVEncoderBitRateKey : 320000,
AVNumberOfChannelsKey: 2,
AVSampleRateKey : 44100.0
]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.