\hypertarget{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine}{}\doxysection{io.\+agora.\+spatialaudio.\+I\+Base\+Spatial\+Audio\+Engine Class Reference}
\label{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine}\index{io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}}
Inheritance diagram for io.\+agora.\+spatialaudio.\+I\+Base\+Spatial\+Audio\+Engine\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classio_1_1agora_1_1spatialaudio_1_1_i_base_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_base_spatial_audio_engine_aa2fca44c204292d74512c95b85b7b895}{set\+Max\+Audio\+Recv\+Count}} (int max\+Count)
\begin{DoxyCompactList}\small\item\em Sets the maximum number of streams that a user can receive in a specified audio reception range. \end{DoxyCompactList}\item 
abstract int \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a7bddc1bd9ec588cc63f7026b240ff12c}{set\+Audio\+Recv\+Range}} (float range)
\begin{DoxyCompactList}\small\item\em Sets the audio reception range of the local user. \end{DoxyCompactList}\item 
abstract int \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a361e2f546725857c565166287d76c7f4}{set\+Distance\+Unit}} (float unit)
\begin{DoxyCompactList}\small\item\em Sets the length (in meters) of the game engine distance per unit. \end{DoxyCompactList}\item 
abstract int \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a349134289e0a6c311a1bc725427ac1a8}{update\+Self\+Position}} (float\mbox{[}$\,$\mbox{]} position, float\mbox{[}$\,$\mbox{]} axis\+Forward, float\mbox{[}$\,$\mbox{]} axis\+Right, float\mbox{[}$\,$\mbox{]} axis\+Up)
\begin{DoxyCompactList}\small\item\em Updates the spatial position of the local user. \end{DoxyCompactList}\item 
abstract int \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a0073091404934f373205d4eb05a05ecf}{update\+Player\+Position\+Info}} (int player\+Id, \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_remote_voice_position_info}{Remote\+Voice\+Position\+Info}} position\+Info)
\begin{DoxyCompactList}\small\item\em Updates the spatial position of the media player. \end{DoxyCompactList}\item 
abstract int \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_ae200e8f707801bc985dac84e8d03496e}{mute\+Local\+Audio\+Stream}} (boolean mute)
\begin{DoxyCompactList}\small\item\em Stops or resumes publishing the local audio stream. \end{DoxyCompactList}\item 
abstract int \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a851679c7fb7a89e2cc750b489ac5ef3c}{mute\+All\+Remote\+Audio\+Streams}} (boolean mute)
\begin{DoxyCompactList}\small\item\em Stops or resumes subscribing to the audio streams of all remote users. \end{DoxyCompactList}\item 
abstract int \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a896cc667b97829c3b80f522864763aff}{set\+Zones}} (\mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_spatial_audio_zone}{Spatial\+Audio\+Zone}}\mbox{[}$\,$\mbox{]} zones)
\begin{DoxyCompactList}\small\item\em Sets the sound insulation area. \end{DoxyCompactList}\item 
abstract int \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a29fb9169ea61fc606738e2a6cb751a57}{set\+Player\+Attenuation}} (int player\+Id, double attenuation, boolean force\+Set)
\begin{DoxyCompactList}\small\item\em Sets the sound attenuation properties of the media player. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_aed61a7e9465461b8ea1cf60ee5464d28}\label{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_aed61a7e9465461b8ea1cf60ee5464d28}} 
abstract int {\bfseries mute\+Remote\+Audio\+Stream} (int uid, boolean mute)
\item 
\mbox{\Hypertarget{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_ab8535311add94498126d22d81ff36be4}\label{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_ab8535311add94498126d22d81ff36be4}} 
abstract int {\bfseries update\+Self\+Position\+Ex} (float\mbox{[}$\,$\mbox{]} position, float\mbox{[}$\,$\mbox{]} axis\+Forward, float\mbox{[}$\,$\mbox{]} axis\+Right, float\mbox{[}$\,$\mbox{]} axis\+Up, \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_base_spatial_audio_engine_a3bd1e0b50356105f66dcdfec5a56cf5e}{clear\+Remote\+Positions}} ()
\begin{DoxyCompactList}\small\item\em Removes the spatial positions of all remote users. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
abstract int \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a9e631d9959b76b09cfa0016d3c83ea0f}{release}} ()
\begin{DoxyCompactList}\small\item\em Releases all resources used by the music content center. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a9e631d9959b76b09cfa0016d3c83ea0f}\label{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a9e631d9959b76b09cfa0016d3c83ea0f}} 
\index{io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}!release@{release}}
\index{release@{release}!io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}}
\doxysubsubsection{\texorpdfstring{release()}{release()}}
{\footnotesize\ttfamily abstract int io.\+agora.\+spatialaudio.\+I\+Base\+Spatial\+Audio\+Engine.\+release (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [abstract]}, {\ttfamily [protected]}}



Releases all resources used by the music content center. 

You must call this method before calling the {\ttfamily destroy()} method of {\ttfamily Rtc\+Engine}. \mbox{\Hypertarget{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_aa2fca44c204292d74512c95b85b7b895}\label{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_aa2fca44c204292d74512c95b85b7b895}} 
\index{io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}!setMaxAudioRecvCount@{setMaxAudioRecvCount}}
\index{setMaxAudioRecvCount@{setMaxAudioRecvCount}!io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}}
\doxysubsubsection{\texorpdfstring{setMaxAudioRecvCount()}{setMaxAudioRecvCount()}}
{\footnotesize\ttfamily abstract int io.\+agora.\+spatialaudio.\+I\+Base\+Spatial\+Audio\+Engine.\+set\+Max\+Audio\+Recv\+Count (\begin{DoxyParamCaption}\item[{int}]{max\+Count }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [abstract]}}



Sets the maximum number of streams that a user can receive in a specified audio reception range. 

If the number of receivable streams exceeds the set value, the local user receives the {\ttfamily max\+Count} streams that are closest to the local user.


\begin{DoxyParams}{Parameters}
{\em max\+Count} & The maximum number of streams that a user can receive within a specified audio reception range. The value of this parameter should be ≤ 16, and the default value is 10.\\
\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_base_spatial_audio_engine_a7bddc1bd9ec588cc63f7026b240ff12c}\label{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a7bddc1bd9ec588cc63f7026b240ff12c}} 
\index{io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}!setAudioRecvRange@{setAudioRecvRange}}
\index{setAudioRecvRange@{setAudioRecvRange}!io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}}
\doxysubsubsection{\texorpdfstring{setAudioRecvRange()}{setAudioRecvRange()}}
{\footnotesize\ttfamily abstract int io.\+agora.\+spatialaudio.\+I\+Base\+Spatial\+Audio\+Engine.\+set\+Audio\+Recv\+Range (\begin{DoxyParamCaption}\item[{float}]{range }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [abstract]}}



Sets the audio reception range of the local user. 

After the setting is successful, the local user can only hear the remote users within the setting range or belonging to the same team. You can call this method at any time to update the audio reception range.


\begin{DoxyParams}{Parameters}
{\em range} & The maximum audio reception range. The unit is meters. The value of this parameter must be greater than 0, and the default value is 20.\\
\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_base_spatial_audio_engine_a361e2f546725857c565166287d76c7f4}\label{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a361e2f546725857c565166287d76c7f4}} 
\index{io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}!setDistanceUnit@{setDistanceUnit}}
\index{setDistanceUnit@{setDistanceUnit}!io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}}
\doxysubsubsection{\texorpdfstring{setDistanceUnit()}{setDistanceUnit()}}
{\footnotesize\ttfamily abstract int io.\+agora.\+spatialaudio.\+I\+Base\+Spatial\+Audio\+Engine.\+set\+Distance\+Unit (\begin{DoxyParamCaption}\item[{float}]{unit }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [abstract]}}



Sets the length (in meters) of the game engine distance per unit. 

In a game engine, the unit of distance is customized, while in the Agora spatial audio algorithm, distance is measured in meters. By default, the S\+DK converts the game engine distance per unit to one meter. You can call this method to convert the game engine distance per unit to a specified number of meters.


\begin{DoxyParams}{Parameters}
{\em unit} & The number of meters that the game engine distance per unit is equal to. The value of this parameter must be greater than 0.\+00, and the default value is 1.\+00. For example, setting unit as 2.\+00 means the game engine distance per unit equals 2 meters.\+The larger the value is, the faster the sound heard by the local user attenuates when the remote user moves far away from the local user.\\
\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_base_spatial_audio_engine_a349134289e0a6c311a1bc725427ac1a8}\label{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a349134289e0a6c311a1bc725427ac1a8}} 
\index{io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}!updateSelfPosition@{updateSelfPosition}}
\index{updateSelfPosition@{updateSelfPosition}!io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}}
\doxysubsubsection{\texorpdfstring{updateSelfPosition()}{updateSelfPosition()}}
{\footnotesize\ttfamily abstract int io.\+agora.\+spatialaudio.\+I\+Base\+Spatial\+Audio\+Engine.\+update\+Self\+Position (\begin{DoxyParamCaption}\item[{float\mbox{[}$\,$\mbox{]}}]{position,  }\item[{float\mbox{[}$\,$\mbox{]}}]{axis\+Forward,  }\item[{float\mbox{[}$\,$\mbox{]}}]{axis\+Right,  }\item[{float\mbox{[}$\,$\mbox{]}}]{axis\+Up }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [abstract]}}



Updates the spatial position of the local user. 


\begin{DoxyItemize}
\item Under the {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_i_local_spatial_audio_engine}{I\+Local\+Spatial\+Audio\+Engine}}} class, this method needs to be used with {\ttfamily update\+Remote\+Position}. The S\+DK calculates the relative position between the local and remote users according to this method and the parameter settings in {\ttfamily update\+Remote\+Position}, and then calculates the user\textquotesingle{}s spatial audio effect parameters.
\end{DoxyItemize}


\begin{DoxyParams}{Parameters}
{\em position} & The coordinates in the world coordinate system. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn. \\
\hline
{\em axis\+Forward} & The unit vector of the x axis in the coordinate system. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn. \\
\hline
{\em axis\+Right} & The unit vector of the y axis in the coordinate system. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn. \\
\hline
{\em axis\+Up} & The unit vector of the z axis in the coordinate system. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.\\
\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_base_spatial_audio_engine_a0073091404934f373205d4eb05a05ecf}\label{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a0073091404934f373205d4eb05a05ecf}} 
\index{io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}!updatePlayerPositionInfo@{updatePlayerPositionInfo}}
\index{updatePlayerPositionInfo@{updatePlayerPositionInfo}!io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}}
\doxysubsubsection{\texorpdfstring{updatePlayerPositionInfo()}{updatePlayerPositionInfo()}}
{\footnotesize\ttfamily abstract int io.\+agora.\+spatialaudio.\+I\+Base\+Spatial\+Audio\+Engine.\+update\+Player\+Position\+Info (\begin{DoxyParamCaption}\item[{int}]{player\+Id,  }\item[{\mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_remote_voice_position_info}{Remote\+Voice\+Position\+Info}}}]{position\+Info }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [abstract]}}



Updates the spatial position of the media player. 

After a successful update, the local user can hear the change in the spatial position of the media player. Call timing\+: This method can be called either before or after joining the channel.


\begin{DoxyParams}{Parameters}
{\em player\+Id} & The ID of the media player. You can get the Device ID by calling {\ttfamily get\+Media\+Player\+Id}. \\
\hline
{\em position\+Info} & The spatial position of the media player. 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_base_spatial_audio_engine_ae200e8f707801bc985dac84e8d03496e}\label{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_ae200e8f707801bc985dac84e8d03496e}} 
\index{io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}!muteLocalAudioStream@{muteLocalAudioStream}}
\index{muteLocalAudioStream@{muteLocalAudioStream}!io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}}
\doxysubsubsection{\texorpdfstring{muteLocalAudioStream()}{muteLocalAudioStream()}}
{\footnotesize\ttfamily abstract int io.\+agora.\+spatialaudio.\+I\+Base\+Spatial\+Audio\+Engine.\+mute\+Local\+Audio\+Stream (\begin{DoxyParamCaption}\item[{boolean}]{mute }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [abstract]}}



Stops or resumes publishing the local audio stream. 

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item This method does not affect any ongoing audio recording, because it does not disable the audio capture device.
\item 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.
\item When using the spatial audio effect, if you need to set whether to stop subscribing to the audio stream of a specified user, Agora recommends calling this method instead of the {\ttfamily mute\+Local\+Audio\+Stream} method in {\ttfamily Rtc\+Engine}.
\item A successful call of this method triggers the {\ttfamily on\+User\+Mute\+Audio} and {\ttfamily on\+Remote\+Audio\+State\+Changed} callbacks on the remote client.
\end{DoxyItemize}
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em mute} & Whether to stop publishing the local audio stream\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: Stop publishing the local audio stream.
\item {\ttfamily false}\+: Publish the local audio stream.
\end{DoxyItemize}\\
\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_base_spatial_audio_engine_a851679c7fb7a89e2cc750b489ac5ef3c}\label{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a851679c7fb7a89e2cc750b489ac5ef3c}} 
\index{io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}!muteAllRemoteAudioStreams@{muteAllRemoteAudioStreams}}
\index{muteAllRemoteAudioStreams@{muteAllRemoteAudioStreams}!io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}}
\doxysubsubsection{\texorpdfstring{muteAllRemoteAudioStreams()}{muteAllRemoteAudioStreams()}}
{\footnotesize\ttfamily abstract int io.\+agora.\+spatialaudio.\+I\+Base\+Spatial\+Audio\+Engine.\+mute\+All\+Remote\+Audio\+Streams (\begin{DoxyParamCaption}\item[{boolean}]{mute }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [abstract]}}



Stops or resumes subscribing to the audio streams of all remote users. 

After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users.

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item 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.
\item When using the spatial audio effect, if you need to set whether to stop subscribing to the audio streams of all remote users, Agora recommends calling this method instead of the {\ttfamily mute\+All\+Remote\+Audio\+Streams} method in {\ttfamily Rtc\+Engine}.
\item After calling this method, you need to call {\ttfamily update\+Self\+Position} and {\ttfamily update\+Remote\+Position} to update the spatial location of the local user and the remote user; otherwise, the settings in this method do not take effect.
\end{DoxyItemize}
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em mute} & Whether to stop subscribing to the audio streams of all remote users\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: Stop subscribing to the audio streams of all remote users.
\item {\ttfamily false}\+: Subscribe to the audio streams of all remote users.
\end{DoxyItemize}\\
\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_base_spatial_audio_engine_a896cc667b97829c3b80f522864763aff}\label{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a896cc667b97829c3b80f522864763aff}} 
\index{io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}!setZones@{setZones}}
\index{setZones@{setZones}!io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}}
\doxysubsubsection{\texorpdfstring{setZones()}{setZones()}}
{\footnotesize\ttfamily abstract int io.\+agora.\+spatialaudio.\+I\+Base\+Spatial\+Audio\+Engine.\+set\+Zones (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_spatial_audio_zone}{Spatial\+Audio\+Zone}}\mbox{[}$\,$\mbox{]}}]{zones }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [abstract]}}



Sets the sound insulation area. 

In virtual interactive scenarios, you can use this method to set the sound insulation area and sound attenuation coefficient. When the sound source (which can be the user or the media player) and the listener belong to the inside and outside of the sound insulation area, they can experience the attenuation effect of sound similar to the real environment when it encounters a building partition.
\begin{DoxyItemize}
\item When the sound source and the listener belong to the inside and outside of the sound insulation area, the sound attenuation effect is determined by the sound attenuation coefficient in {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_spatial_audio_zone}{Spatial\+Audio\+Zone}}}.
\item If the user or media player is in the same sound insulation area, it is not affected by {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_spatial_audio_zone}{Spatial\+Audio\+Zone}}}, and the sound attenuation effect is determined by the {\ttfamily attenuation} parameter in {\ttfamily set\+Player\+Attenuation} or {\ttfamily set\+Remote\+Audio\+Attenuation}. If you do not call {\ttfamily set\+Player\+Attenuation} or {\ttfamily set\+Remote\+Audio\+Attenuation}, the default sound attenuation coefficient of the S\+DK is 0.\+5, which simulates the attenuation of the sound in the real environment.
\item If the sound source and the receiver belong to two sound insulation areas, the receiver cannot hear the sound source.
\end{DoxyItemize}

\begin{DoxyNote}{Note}
If this method is called multiple times, the last sound insulation area set takes effect.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em zones} & Sound insulation area settings. See {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_spatial_audio_zone}{Spatial\+Audio\+Zone}}}. When you set this parameter to {\ttfamily N\+U\+LL}, it means clearing all sound insulation zones.\\
\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_base_spatial_audio_engine_a29fb9169ea61fc606738e2a6cb751a57}\label{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a29fb9169ea61fc606738e2a6cb751a57}} 
\index{io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}!setPlayerAttenuation@{setPlayerAttenuation}}
\index{setPlayerAttenuation@{setPlayerAttenuation}!io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}}
\doxysubsubsection{\texorpdfstring{setPlayerAttenuation()}{setPlayerAttenuation()}}
{\footnotesize\ttfamily abstract int io.\+agora.\+spatialaudio.\+I\+Base\+Spatial\+Audio\+Engine.\+set\+Player\+Attenuation (\begin{DoxyParamCaption}\item[{int}]{player\+Id,  }\item[{double}]{attenuation,  }\item[{boolean}]{force\+Set }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [abstract]}}



Sets the sound attenuation properties of the media player. 


\begin{DoxyParams}{Parameters}
{\em player\+Id} & The ID of the media player. You can get the Device ID by calling {\ttfamily get\+Media\+Player\+Id}. \\
\hline
{\em attenuation} & The sound attenuation coefficient of the remote user or media player. 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 sound attenuation effect of the media player\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: Force {\ttfamily attenuation} to set the attenuation of the media player. At this time, the attenuation coefficient of the sound insulation are set in the {\ttfamily audio\+Attenuation} in the {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1spatialaudio_1_1_spatial_audio_zone}{Spatial\+Audio\+Zone}}} does not take effect for the media player.
\item {\ttfamily false}\+: Do not force {\ttfamily attenuation} to set the sound attenuation effect of the media player, 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}
\mbox{\Hypertarget{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a3bd1e0b50356105f66dcdfec5a56cf5e}\label{classio_1_1agora_1_1spatialaudio_1_1_i_base_spatial_audio_engine_a3bd1e0b50356105f66dcdfec5a56cf5e}} 
\index{io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}!clearRemotePositions@{clearRemotePositions}}
\index{clearRemotePositions@{clearRemotePositions}!io.agora.spatialaudio.IBaseSpatialAudioEngine@{io.agora.spatialaudio.IBaseSpatialAudioEngine}}
\doxysubsubsection{\texorpdfstring{clearRemotePositions()}{clearRemotePositions()}}
{\footnotesize\ttfamily abstract int io.\+agora.\+spatialaudio.\+I\+Base\+Spatial\+Audio\+Engine.\+clear\+Remote\+Positions (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [abstract]}}



Removes 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.

\begin{DoxyReturn}{Returns}

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