\hypertarget{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}{}\doxysection{io.\+agora.\+spatialaudio.\+I\+Local\+Spatial\+Audio\+Engine Class Reference}
\label{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}\index{io.agora.spatialaudio.ILocalSpatialAudioEngine@{io.agora.spatialaudio.ILocalSpatialAudioEngine}}
Inheritance diagram for io.\+agora.\+spatialaudio.\+I\+Local\+Spatial\+Audio\+Engine\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
abstract int \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a07d4168d3783232b6fe77fa73c49ba66}{initialize}} (\mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_local_spatial_audio_config}{Local\+Spatial\+Audio\+Config}} config)
\begin{DoxyCompactList}\small\item\em Initializes {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}{I\+Local\+Spatial\+Audio\+Engine}}}. \end{DoxyCompactList}\item 
abstract int \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a4128f95250f715a740a3ceb11ccb576d}{update\+Remote\+Position}} (int uid, \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_remote_voice_position_info}{Remote\+Voice\+Position\+Info}} pos\+Info)
\begin{DoxyCompactList}\small\item\em Updates the spatial position of the specified remote user. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_ab5a1d224cda7ae46dd589230dadc589e}\label{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_ab5a1d224cda7ae46dd589230dadc589e}} 
abstract int {\bfseries update\+Remote\+Position\+Ex} (int uid, \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_remote_voice_position_info}{Remote\+Voice\+Position\+Info}} pos\+Info, \mbox{\hyperlink{classio_1_1agora_1_1rtc2_1_1_rtc_connection}{Rtc\+Connection}} connection)
\item 
abstract int \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_adb1bcbd251edd6d5c0559a4227033a92}{remove\+Remote\+Position}} (int uid)
\begin{DoxyCompactList}\small\item\em Removes the spatial position of the specified remote user. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a6fbe71b04bd537600b63d4e25f785b23}\label{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a6fbe71b04bd537600b63d4e25f785b23}} 
abstract int {\bfseries remove\+Remote\+Position\+Ex} (int uid, \mbox{\hyperlink{classio_1_1agora_1_1rtc2_1_1_rtc_connection}{Rtc\+Connection}} connection)
\item 
\mbox{\Hypertarget{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a0986efa6d5a9e32ab71b6dba4192816f}\label{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a0986efa6d5a9e32ab71b6dba4192816f}} 
abstract int {\bfseries clear\+Remote\+Positions\+Ex} (\mbox{\hyperlink{classio_1_1agora_1_1rtc2_1_1_rtc_connection}{Rtc\+Connection}} connection)
\item 
abstract int \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a51e6697ce1978b52e5d1744a99df685b}{set\+Remote\+Audio\+Attenuation}} (int uid, double attenuation, boolean force\+Set)
\begin{DoxyCompactList}\small\item\em Sets the sound attenuation effect for the specified user. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static synchronized \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}{I\+Local\+Spatial\+Audio\+Engine}} \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a0916ebb5331f9339152c480a2486b61c}{create}} ()
\begin{DoxyCompactList}\small\item\em Creates {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}{I\+Local\+Spatial\+Audio\+Engine}}}. \end{DoxyCompactList}\item 
static synchronized void \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a07a139f13cb77ab07716ca2ce98c8cc3}{destroy}} ()
\begin{DoxyCompactList}\small\item\em Destroys {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}{I\+Local\+Spatial\+Audio\+Engine}}}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Additional Inherited Members}


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a0916ebb5331f9339152c480a2486b61c}\label{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a0916ebb5331f9339152c480a2486b61c}} 
\index{io.agora.spatialaudio.ILocalSpatialAudioEngine@{io.agora.spatialaudio.ILocalSpatialAudioEngine}!create@{create}}
\index{create@{create}!io.agora.spatialaudio.ILocalSpatialAudioEngine@{io.agora.spatialaudio.ILocalSpatialAudioEngine}}
\doxysubsubsection{\texorpdfstring{create()}{create()}}
{\footnotesize\ttfamily static synchronized \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}{I\+Local\+Spatial\+Audio\+Engine}} io.\+agora.\+spatialaudio.\+I\+Local\+Spatial\+Audio\+Engine.\+create (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Creates {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}{I\+Local\+Spatial\+Audio\+Engine}}}. 

Call this method before {\ttfamily initialize}.

\begin{DoxyReturn}{Returns}
{\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}{I\+Local\+Spatial\+Audio\+Engine}}} 
\end{DoxyReturn}
\mbox{\Hypertarget{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a07a139f13cb77ab07716ca2ce98c8cc3}\label{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a07a139f13cb77ab07716ca2ce98c8cc3}} 
\index{io.agora.spatialaudio.ILocalSpatialAudioEngine@{io.agora.spatialaudio.ILocalSpatialAudioEngine}!destroy@{destroy}}
\index{destroy@{destroy}!io.agora.spatialaudio.ILocalSpatialAudioEngine@{io.agora.spatialaudio.ILocalSpatialAudioEngine}}
\doxysubsubsection{\texorpdfstring{destroy()}{destroy()}}
{\footnotesize\ttfamily static synchronized void io.\+agora.\+spatialaudio.\+I\+Local\+Spatial\+Audio\+Engine.\+destroy (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Destroys {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}{I\+Local\+Spatial\+Audio\+Engine}}}. 

This method releases all resources under {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}{I\+Local\+Spatial\+Audio\+Engine}}}. When the user does not need to use the spatial audio effect, you can call this method to release resources for other operations. After calling this method, you can no longer use any of the A\+P\+Is under {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}{I\+Local\+Spatial\+Audio\+Engine}}}. To use the spatial audio effect again, you need to wait until the {\ttfamily destroy} method execution to complete before calling {\ttfamily initialize} to create a new {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}{I\+Local\+Spatial\+Audio\+Engine}}}.

\begin{DoxyNote}{Note}
Call this method before the {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a07a139f13cb77ab07716ca2ce98c8cc3}{destroy()}}} method under {\ttfamily Rtc\+Engine}. 
\end{DoxyNote}
\mbox{\Hypertarget{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a07d4168d3783232b6fe77fa73c49ba66}\label{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a07d4168d3783232b6fe77fa73c49ba66}} 
\index{io.agora.spatialaudio.ILocalSpatialAudioEngine@{io.agora.spatialaudio.ILocalSpatialAudioEngine}!initialize@{initialize}}
\index{initialize@{initialize}!io.agora.spatialaudio.ILocalSpatialAudioEngine@{io.agora.spatialaudio.ILocalSpatialAudioEngine}}
\doxysubsubsection{\texorpdfstring{initialize()}{initialize()}}
{\footnotesize\ttfamily abstract int io.\+agora.\+spatialaudio.\+I\+Local\+Spatial\+Audio\+Engine.\+initialize (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_local_spatial_audio_config}{Local\+Spatial\+Audio\+Config}}}]{config }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [abstract]}}



Initializes {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}{I\+Local\+Spatial\+Audio\+Engine}}}. 

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item Call this method after calling {\ttfamily create}.
\item Before calling other methods of the {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}{I\+Local\+Spatial\+Audio\+Engine}}} class, you need to call this method to initialize {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}{I\+Local\+Spatial\+Audio\+Engine}}}.
\item The S\+DK supports creating only one {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}{I\+Local\+Spatial\+Audio\+Engine}}} instance for an app.
\end{DoxyItemize}
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em config} & The configuration of {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}{I\+Local\+Spatial\+Audio\+Engine}}}. See {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_local_spatial_audio_config}{Local\+Spatial\+Audio\+Config}}}.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a4128f95250f715a740a3ceb11ccb576d}\label{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a4128f95250f715a740a3ceb11ccb576d}} 
\index{io.agora.spatialaudio.ILocalSpatialAudioEngine@{io.agora.spatialaudio.ILocalSpatialAudioEngine}!updateRemotePosition@{updateRemotePosition}}
\index{updateRemotePosition@{updateRemotePosition}!io.agora.spatialaudio.ILocalSpatialAudioEngine@{io.agora.spatialaudio.ILocalSpatialAudioEngine}}
\doxysubsubsection{\texorpdfstring{updateRemotePosition()}{updateRemotePosition()}}
{\footnotesize\ttfamily abstract int io.\+agora.\+spatialaudio.\+I\+Local\+Spatial\+Audio\+Engine.\+update\+Remote\+Position (\begin{DoxyParamCaption}\item[{int}]{uid,  }\item[{\mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_remote_voice_position_info}{Remote\+Voice\+Position\+Info}}}]{pos\+Info }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [abstract]}}



Updates the spatial position of the specified remote user. 

After successfully calling this method, the S\+DK calculates the spatial audio parameters based on the relative position of the local and remote user.

\begin{DoxyNote}{Note}
Call this method after the {\ttfamily join\+Channel(\+String token, String channel\+Id, String optional\+Info, int uid)} or {\ttfamily join\+Channel(\+String token, String channel\+Id, int uid, Channel\+Media\+Options options)} method.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em uid} & The user ID. This parameter must be the same as the user ID passed in when the user joined the channel. \\
\hline
{\em pos\+Info} & The spatial position of the remote user. See {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_remote_voice_position_info}{Remote\+Voice\+Position\+Info}}}.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_adb1bcbd251edd6d5c0559a4227033a92}\label{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_adb1bcbd251edd6d5c0559a4227033a92}} 
\index{io.agora.spatialaudio.ILocalSpatialAudioEngine@{io.agora.spatialaudio.ILocalSpatialAudioEngine}!removeRemotePosition@{removeRemotePosition}}
\index{removeRemotePosition@{removeRemotePosition}!io.agora.spatialaudio.ILocalSpatialAudioEngine@{io.agora.spatialaudio.ILocalSpatialAudioEngine}}
\doxysubsubsection{\texorpdfstring{removeRemotePosition()}{removeRemotePosition()}}
{\footnotesize\ttfamily abstract int io.\+agora.\+spatialaudio.\+I\+Local\+Spatial\+Audio\+Engine.\+remove\+Remote\+Position (\begin{DoxyParamCaption}\item[{int}]{uid }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [abstract]}}



Removes 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\textquotesingle{}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 {\ttfamily set\+Max\+Audio\+Recv\+Count}, the system automatically unsubscribes from the audio stream of the user who is furthest away based on relative distance.


\begin{DoxyParams}{Parameters}
{\em uid} & The user ID. This parameter must be the same as the user ID passed in when the user joined the channel.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a51e6697ce1978b52e5d1744a99df685b}\label{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine_a51e6697ce1978b52e5d1744a99df685b}} 
\index{io.agora.spatialaudio.ILocalSpatialAudioEngine@{io.agora.spatialaudio.ILocalSpatialAudioEngine}!setRemoteAudioAttenuation@{setRemoteAudioAttenuation}}
\index{setRemoteAudioAttenuation@{setRemoteAudioAttenuation}!io.agora.spatialaudio.ILocalSpatialAudioEngine@{io.agora.spatialaudio.ILocalSpatialAudioEngine}}
\doxysubsubsection{\texorpdfstring{setRemoteAudioAttenuation()}{setRemoteAudioAttenuation()}}
{\footnotesize\ttfamily abstract int io.\+agora.\+spatialaudio.\+I\+Local\+Spatial\+Audio\+Engine.\+set\+Remote\+Audio\+Attenuation (\begin{DoxyParamCaption}\item[{int}]{uid,  }\item[{double}]{attenuation,  }\item[{boolean}]{force\+Set }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [abstract]}}



Sets the sound attenuation effect for the specified user. 


\begin{DoxyParams}{Parameters}
{\em uid} & The user ID. This parameter must be the same as the user ID passed in when the user joined the channel. \\
\hline
{\em attenuation} & For the user\textquotesingle{}s sound attenuation coefficient, the value range is \mbox{[}0,1\mbox{]}. The values are as follows\+:
\begin{DoxyItemize}
\item 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.
\item (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.
\item 0.\+5\+: (Default) simulates the attenuation of the volume in the real environment; the effect is equivalent to not setting the {\ttfamily speaker\+\_\+attenuation} parameter.
\item (0.\+5,1\mbox{]}\+: Strong attenuation mode, that is, the volume and timbre attenuate rapidly during the propagation process. 
\end{DoxyItemize}\\
\hline
{\em force\+Set} & Whether to force the user\textquotesingle{}s sound attenuation effect\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: Force {\ttfamily attenuation} to set the sound attenuation of the user. At this time, the {\ttfamily attenuation} coefficient of the sound insulation area set in the {\ttfamily audio\+Attenuation} of the {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_spatial_audio_zone}{Spatial\+Audio\+Zone}}} does not take effect for the user.
\item {\ttfamily false}\+: Do not force {\ttfamily attenuation} to set the user\textquotesingle{}s sound attenuation effect, as shown in the following two cases.
\begin{DoxyItemize}
\item If the sound source and listener are inside and outside the sound isolation area, the sound attenuation effect is determined by the {\ttfamily audio\+Attenuation} in {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_spatial_audio_zone}{Spatial\+Audio\+Zone}}}.
\item 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 {\ttfamily attenuation} in this method.
\end{DoxyItemize}
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
