Arien Fqudioe
Arien Fqudioe

Reputation: 21

Joining a channel on Agora (Unity/iOS) makes in-game music almost inaudible

I'm trying to integrate Agora voice SDK in a multiplayer project (built using Photon). The level has loads of 3D spacial audio setup and a background music that is properly audible. The moment I join a voice channel, all the in-game audio levels drop drastically. The voice chat volume itself sounds fine however. And this happens only on actual device(iOS), not on Unity editor.

I tried reproducing this issue in the HelloUnity3D sample scene that comes with the SDK. No code change. Simply added an audio source in the scene with a music clip. Seems to be happening there as well.

Is this expected? How do I keep Agora from modifying other audio sources?

Unity version:2020.3.28f1. Agora SDK version: 3.5.0.70

Upvotes: 0

Views: 897

Answers (3)

LinxiNotLinux
LinxiNotLinux

Reputation: 7

I faced a similar issue in my Unity project. Using headphones did work, but there was significant echo leakage when using the device's speakers. In my case, I was using the Wwise audio engine, and I found the GME for Wwise plugin to be helpful in maintaining desired audio levels for both in-game sounds and voice chat without echo leakage. If your project also uses Wwise, you might look into the GME for Wwise plugin. However, if you're using a different audio engine, you may need to explore other solutions.

Upvotes: 0

Arien Fqudioe
Arien Fqudioe

Reputation: 21

For anyone running into this issue, I was able to fix it by setting the audio profile to AUDIO_SCENARIO_GAME_STREAMING.

mRtcEngine.SetAudioProfile(AUDIO_PROFILE_TYPE.AUDIO_PROFILE_SPEECH_STANDARD, AUDIO_SCENARIO_TYPE.AUDIO_SCENARIO_GAME_STREAMING);

The idea is to simply treat the voice chat audio as media volume instead of 'call' volume.

Upvotes: 2

maxxfrazer
maxxfrazer

Reputation: 1253

This answer about audio ducking with the Agora SDK is likely what you're after. You might have to add some iOS specific code to your project to achieve it:

https://stackoverflow.com/a/62840934/2156765

Upvotes: 0

Related Questions