gpt4 book ai didi

AVAudioSession Deactivated when I leave Channel Agora Voice Unity SDK(当我离开频道Agora Voice Unity SDK时,AVAudioSession被停用)

转载 作者:bug小助手 更新时间:2023-10-26 19:59:24 27 4
gpt4 key购买 nike



I am using Agora Voice Unity SDK for voice calling in my App.
I facing a problem that when I leave channel on iPhone . My button clicks sounds stops working.

我在我的应用程序中使用Agora Voice Unity SDK进行语音呼叫。我面临着一个问题,当我离开iPhone的频道时。我的按钮卡丁声停止工作。


by investigating I found "AVAudioSession" is deactivating on leaving channel.

通过调查,我发现“AVAudioSession”在离开频道时处于停用状态。


Here is the Console Log Statement:

以下是控制台日志语句:



"2023-08-04 01:03:29.359231-0700 AgoraVoicetest[1362:131944] [avas] AVAudioSession_iOS.mm:1271 Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session."



This log appears when I leave channel.

当我离开频道时,会出现这个日志。


Here is my code screenshot for leave channel.

这是我的Leave频道代码截图。


Leave Channel Function SS (C# , Unity)


I have tried "DisableAudio()" function upon leaving channel.
Expected result: Upon leaving channel , only voice communication should be disabled/disconnect . Game media sounds (e.g: Button click sounds) should remain active.

我已经尝试了离开频道时的“DisableAudio()”函数。预期结果:离开通道后,仅应禁用/断开语音通信。游戏媒体声音(例如:按钮点击声音)应保持活动状态。


更多回答

Why should I not upload images of code/data/errors?

为什么我不应该上传代码/数据/错误的图像?

优秀答案推荐

For others running into this issue on iOS, Agora's support team helped me with putting the following code before joining a channel:

对于在iOS上遇到这个问题的其他人,Agora的支持团队帮助我在加入频道之前放置了以下代码:


_myRtcEngine.SetParameters("{\"che.audio.keep.audiosession\":true}");

The long and short of it is that iOS audio sessions are shared and Agora needs to make sure to return/restore that AVAudioSession

总而言之,iOS音频会话是共享的,Agora需要确保返回/恢复AVAudioSession


更多回答

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com