iOS Audio Ducking Issue in Daily.co SDK

25 Views Asked by At

I'm currently dealing with an audio ducking issue on iOS devices in my application, where the iOS audio ducking feature doesn't seem to affect my code, whether enabled or disabled.

In the context of my application, I utilize the Daily.co SDK for video calls, and I'm facing an audio ducking problem when muting and unmuting participants. The primary goal is to prevent background music in my app from being ducked when muting a participant in a Daily.co call.

The muting functionality is implemented using the following code:

```javascript
const { audioTrackState } = useTileParticipant(localUserSessionId);
const audioTrack = useMemo(() => audioTrackState?.track, [audioTrackState]);
dailyCallObject.setLocalAudio(false);
if (audioTrack) audioTrack?.stop();

This code successfully stops audio tracks when muting participants. However, when all participants are muted, there is no audio ducking issue – the background music plays smoothly, irrespective of participants speaking or staying silent.

The challenge arises when a participant is unmuted. Audio ducking occurs for that participant. However, when that participant is muted again, audio ducking persists until all participants are muted once more.

I've explored various approaches to address the audio ducking issue in my iOS application using the Daily.co SDK. Specifically, I've attempted the following:

Implemented muting functionality using dailyCallObject.setLocalAudio(false) and stopping the audio track when muting participants. Examined the behavior when all participants are muted, resulting in the desired outcome of smooth background music playback without audio ducking. Observed the audio ducking issue when a participant is unmuted. Noted that audio ducking persists for a previously unmuted participant even when they are muted again. The issue continues until all participants are muted. Despite these efforts, the audio ducking problem remains unresolved. I'm seeking guidance on potential code adjustments or suggestions for utilizing Daily.co SDK features to achieve the desired behavior. Any assistance in resolving this issue would be greatly appreciated.

0

There are 0 best solutions below