Skype for business iOS SDK:无法启动音频服务
Posted
技术标签:
【中文标题】Skype for business iOS SDK:无法启动音频服务【英文标题】:Skype for business iOS SDK: unable to start audioservice 【发布时间】:2016-11-12 21:33:05 【问题描述】:我正在集成 Skype 的 ios SDK,当我尝试从对话助手启动音频服务时。
do
try self.conversationHelper.conversation.audioService.start()
catch
print(error.localizedDescription)
我收到了这个错误。音频既没有通过也没有消失。 (但视频服务运行良好。)
2016-11-12 21:22:00.012 test-skype[669:1aa91fc40] INFO APPLICATION CUcmpAudioModality.cpp:230 CUcmpAudioModality::start(AudioType) called.
2016-11-12 21:22:00.014 test-skype[669:1aa91fc40] INFO APPLICATION CUcmpAudioModality.cpp:259 CUcmpAudioModality::start(AudioType, CUriString) called.
2016-11-12 21:22:00.015 test-skype[669:1aa91fc40] INFO APPLICATION CUcmpAudioVideoModality.cpp:2799 CUcmpAudioModality::queryCapability on StartVoIP returned false because modality state is InConversation
2016-11-12 21:22:00.017 test-skype[669:1aa91fc40] ERROR APPLICATION CUcmpAudioModality.cpp:267 Unable to start audio with error (587726849)
我该如何解决这个问题?请帮忙。
【问题讨论】:
【参考方案1】:我设法找到了解决方案。我需要先初始化AVAudioSession
并将类别设置为AVAudioSessionCategoryPlayAndRecord
才能使其工作。
let audioSession: AVAudioSession = AVAudioSession.sharedInstance()
do
try audioSession.setCategory(AVAudioSessionCategoryPlayAndRecord)
catch let errorForCategory as Error
print(errorForCategory.localizedDescription)
do
try audioSession.setMode(AVAudioSessionModeVoiceChat)
catch let errorForMode as Error
print(errorForMode.localizedDescription)
编辑:如果您打算在视频聊天中使用 Airplay,您需要将模式设置为 AVAudioSessionModeVideoChat
,如本文档中所述。
https://developer.apple.com/library/content/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionBasics/AudioSessionBasics.html
do
try audioSession.setMode(AVAudioSessionModeVideoChat)
catch let errorForMode as Error
print(errorForMode.localizedDescription)
【讨论】:
以上是关于Skype for business iOS SDK:无法启动音频服务的主要内容,如果未能解决你的问题,请参考以下文章
Skype for business URI 而不是 Skype
Skype For Business 2015实战系列1:初识Skype 2015
Excel VBA - 显示 Skype 联系人卡片 (Skype for Business)
Skype Web SDK - Skype For Business Online