Options
All
  • Public
  • Public/Protected
  • All
Menu

Module classes/HiFiMixerSession

Code in this module is used by HiFiCommunicator object to manage the connection between client and server. This module is also home to some types used to manage client volume state, for example OnMuteChangedCallback. The class HiFiMixerSession is an internal class. Developers do not need to and should not consider it when writing their applications.

Index

Type aliases

OnMuteChangedCallback

OnMuteChangedCallback: (muteChangedEvent: MuteChangedEvent) => void

An onMuteChanged callback function with this signature can be provided to HiFiCommunicator.constructor. The function you provide will be called whenever the mute state of the client may have updated.

One situation where this is useful is when the client's mute state has been changed by an admin, i.e. when MuteChangedEvent.muteReason is MuteReason.ADMIN. If MuteChangedEvent.adminPreventsInputAudioUnmuting is true, then the client is muted, and is prevented from unmuting when using HiFiCommunicator.setInputAudioMuted. If MuteChangedEvent.adminPreventsInputAudioUnmuting is false, then the client is no longer prevented from unmuting, but is not automatically unmuted. The client is allowed to mute themself at any time regardless of the current mute state.

If MuteChangedEvent.muteReason is equal to MuteReason.CLIENT, the client attempted to set the mute state through HiFiCommunicator.setInputAudioMuted.

If MuteChangedEvent.muteReason is equal to MuteReason.INTERNAL, the client's mute state has changed due to an implementation detail of the spatial audio API, for example to keep the state of the client consistent with the server.

This callback can also be used to keep track of whether the client is muted and display this in the client UI, and can also be used for debugging purposes. The mute state of the client may not have changed after this callback.

Type declaration

SetOtherUserGainForThisConnectionResponse

SetOtherUserGainForThisConnectionResponse: SetOtherUserGainsForThisConnectionResponse

The result of calling HiFiCommunicator.setOtherUserGainForThisConnection, which adjusts the gain of another user for the communicator's current connection only.