我在 xcode10.1 中使用 Chirp SDK 进行超声波。我在日志中多次收到此警告消息:
[avas] AVAudioSessionPortImpl.mm:56:ValidateRequiredFields:端口扬声器的未知选定数据源(类型:扬声器)
我试过下面的
let audioSession = AVAudioSession.sharedInstance()
do {
try audioSession.setCategory(AVAudioSession.Category.playAndRecord, mode: .spokenAudio, options: .defaultToSpeaker)
try audioSession.setActive(true, options: .notifyOthersOnDeactivation)
} catch {
print("audioSession properties weren't set because of an error.")
}
但仍然对我显示警告。如何解决此警告。在此先感谢