0
(接続のためにTwilioVideo SDKを使用して)、音声通話中に変更 鉱山コード:iOSの私はiPhoneのスピーカー(耳と下部)を実装する必要があるの変更デバイスのスピーカー
let audioSession = AVAudioSession.sharedInstance()
do {
if isSpeaker == false {
try audioSession.overrideOutputAudioPort(.speaker)
isSpeaker = true
} else {
try audioSession.overrideOutputAudioPort(.none)
isSpeaker = false
}
try audioSession.setActive(true)
} catch {
handleError(error.localizedDescription)
}
それは、例外なしに動作しますが、ドン」オーディオ出力スピーカーを変更する
これはうまくいきます、ありがとうございます。 しかし、Twilioのlibの中のaudioSessionにカテゴリを設定する方法はありますか? – Viktor
4つの出力設定は、TVIAudioOutputVideoChatDefault、TVIAudioOutputVideoChatSpeaker、TVIAudioOutputVoiceChatDefault、およびTVIAudioOutputVoiceChatSpeakerです。 – philnash
AVAudioSessionCategoryPlayAndRecordカテゴリを意味します。私はgreen in-call statusBarを表示する必要があり、https://stackoverflow.com/a/31704318/4899912に従って、このカテゴリをAVAudioSessionに設定する必要があります。それをsharedInstanceに設定すると助けにならない – Viktor