Package io.agora.spatialaudio
Class ILocalSpatialAudioEngine
java.lang.Object
io.agora.spatialaudio.IBaseSpatialAudioEngine
io.agora.spatialaudio.ILocalSpatialAudioEngine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract intclearRemotePositionsEx(RtcConnection connection) static ILocalSpatialAudioEnginecreate()static voiddestroy()abstract intinitialize(LocalSpatialAudioConfig config) abstract intremoveRemotePosition(int uid) abstract intremoveRemotePositionEx(int uid, RtcConnection connection) abstract intsetRemoteAudioAttenuation(int uid, double attenuation, boolean forceSet) abstract intupdateRemotePosition(int uid, RemoteVoicePositionInfo posInfo) abstract intupdateRemotePositionEx(int uid, RemoteVoicePositionInfo posInfo, RtcConnection connection) Methods inherited from class io.agora.spatialaudio.IBaseSpatialAudioEngine
clearRemotePositions, muteAllRemoteAudioStreams, muteLocalAudioStream, muteRemoteAudioStream, setAudioRecvRange, setDistanceUnit, setMaxAudioRecvCount, setPlayerAttenuation, setZones, updatePlayerPositionInfo, updateSelfPosition, updateSelfPositionEx
-
Constructor Details
-
ILocalSpatialAudioEngine
public ILocalSpatialAudioEngine()
-
-
Method Details
-
create
- Returns:
- `ILocalSpatialAudioEngine`
-
destroy
public static void destroy() -
initialize
- Parameters:
config- The configuration of `ILocalSpatialAudioEngine`. See `LocalSpatialAudioConfig`.- Returns:
- - 0: Success. - < 0: Failure.
-
updateRemotePosition
- Parameters:
uid- The user ID. This parameter must be the same as the user ID passed in when the user joined the channel.posInfo- The spatial position of the remote user. See `RemoteVoicePositionInfo`.- Returns:
- - 0: Success. - < 0: Failure.
-
updateRemotePositionEx
public abstract int updateRemotePositionEx(int uid, RemoteVoicePositionInfo posInfo, RtcConnection connection) -
removeRemotePosition
public abstract int removeRemotePosition(int uid) - Parameters:
uid- The user ID. This parameter must be the same as the user ID passed in when the user joined the channel.- Returns:
- - 0: Success. - < 0: Failure.
-
removeRemotePositionEx
-
clearRemotePositionsEx
-
setRemoteAudioAttenuation
public abstract int setRemoteAudioAttenuation(int uid, double attenuation, boolean forceSet) - Parameters:
uid- The user ID. This parameter must be the same as the user ID passed in when the user joined the channel.attenuation- 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.forceSet- 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. - `false`: Do not force `attenuation` to set the user's sound attenuation effect, as shown in the following two cases. - 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.- Returns:
- - 0: Success. - < 0: Failure.
-