Abstract
Abstract
clearRemoves the spatial positions of all remote users.
After successfully calling this method, the local user no longer hears any remote users. After leaving the channel, to avoid wasting resources, you can also call this method to delete the spatial positions of all remote users.
0: Success. < 0: Failure.
Abstract
initializeInitializes ILocalSpatialAudioEngine.
Before calling other methods of the ILocalSpatialAudioEngine class, you need to call this method to initialize ILocalSpatialAudioEngine. The SDK supports creating only one ILocalSpatialAudioEngine instance for an app.
0: Success. < 0: Failure.
Abstract
removeRemoves the spatial position of the specified remote user.
After successfully calling this method, the local user no longer hears the specified remote user. After leaving the channel, to avoid wasting computing resources, call this method to delete the spatial position information of the specified remote user. Otherwise, the user's spatial position information will be saved continuously. When the number of remote users exceeds the number of audio streams that can be received as set in setMaxAudioRecvCount, the system automatically unsubscribes from the audio stream of the user who is furthest away based on relative distance.
0: Success. < 0: Failure.
The user ID. This parameter must be the same as the user ID passed in when the user joined the channel.
Abstract
setSets the sound attenuation effect for the specified user.
0: Success. < 0: Failure.
The user ID. This parameter must be the same as the user ID passed in when the user joined the channel.
For the user's sound attenuation coefficient, the value range is [0,1]. The values are as follows: 0: Broadcast mode, where the volume and timbre are not attenuated with distance, and the volume and timbre heard by local users do not change regardless of distance. (0,0.5): Weak attenuation mode, that is, the volume and timbre are only weakly attenuated during the propagation process, and the sound can travel farther than the real environment. 0.5: (Default) simulates the attenuation of the volume in the real environment; the effect is equivalent to not setting the speaker_attenuation parameter. (0.5,1]: Strong attenuation mode, that is, the volume and timbre attenuate rapidly during the propagation process.
Whether to force the user's sound attenuation effect: true : Force attenuation to set the sound attenuation of the user. At this time, the attenuation coefficient of the sound insulation area set in the audioAttenuation of the SpatialAudioZone does not take effect for the user. If the sound source and listener are inside and outside the sound isolation area, the sound attenuation effect is determined by the audioAttenuation in SpatialAudioZone. If the sound source and the listener are in the same sound insulation area or outside the same sound insulation area, the sound attenuation effect is determined by attenuation in this method. false : Do not force attenuation to set the user's sound attenuation effect, as shown in the following two cases.
Abstract
updateUpdates the spatial position of the specified remote user.
After successfully calling this method, the SDK calculates the spatial audio parameters based on the relative position of the local and remote user. Call this method after the or joinChannel method.
0: Success. < 0: Failure.
The user ID. This parameter must be the same as the user ID passed in when the user joined the channel.
The spatial position of the remote user. See RemoteVoicePositionInfo.
Generated using TypeDoc
This class calculates user positions through the SDK to implement the spatial audio effect.
This class inherits from IBaseSpatialAudioEngine. Before calling other APIs in this class, you need to call the initialize method to initialize this class.