Does `adjustUserAudioVolumeLocally()` Work Before the Remote Audio Stream Is Available?

Hi,

I have a question regarding the Zoom Video SDK Web audio APIs.

I noticed that calling:

stream.muteUserAudioLocally(userId);
stream.unmuteUserAudioLocally(userId);

before the remote user’s audio stream is available does not seem to have any effect. The mute/unmute state is not applied once the remote audio stream becomes available.

I would like to understand how adjustUserAudioVolumeLocally() behaves in the same scenario.

If I call:

stream.adjustUserAudioVolumeLocally(userId, 0);

before the remote user’s audio stream is available:

  1. Does the SDK store this volume setting and apply it automatically when the remote audio stream becomes available?

  2. Or does the function only work when the remote user’s audio stream is already available?

  3. If it only works when the audio stream is available, what is the recommended event/callback to use to apply the volume setting when the remote audio becomes available?

Any clarification on the expected behavior would be helpful.

Hey @Seya

Sorry for the late reply.

  1. Does the SDK store this volume setting and apply it automatically when the remote audio stream becomes available?

No, it won’t — if the remote hasn’t started audio, the receiving side has no way to set that user’s audio volume.

  1. Or does the function only work when the remote user’s audio stream is already available?

Yes. Correct.

  1. If it only works when the audio stream is available, what is the recommended event/callback to use to apply the volume setting when the remote audio becomes available?

You can listen for the user-updated event, and once the remote user’s audio property changes from "" (empty string) to "computer", you can then call muteUserAudioLocally or adjustUserAudioVolumeLocally to adjust their volume.

Thanks
Vic