\hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base}{}\doxysection{agora\+::media\+::I\+Audio\+Frame\+Observer\+Base Class Reference}
\label{classagora_1_1media_1_1_i_audio_frame_observer_base}\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}


{\ttfamily \#include $<$Agora\+Media\+Base.\+h$>$}

Inheritance diagram for agora\+::media\+::I\+Audio\+Frame\+Observer\+Base\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classagora_1_1media_1_1_i_audio_frame_observer_base}
\end{center}
\end{figure}
\doxysubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{Audio\+Frame}}
\begin{DoxyCompactList}\small\item\em Raw audio data. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_params}{Audio\+Params}}
\begin{DoxyCompactList}\small\item\em Audio data format. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
enum \mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_aa0e2b429cd1e9e55f60614adffa01dac}{A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+T\+Y\+PE}} \{ \mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_aa0e2b429cd1e9e55f60614adffa01daca434ef108ae62459f31354c79a4ee8d48}{F\+R\+A\+M\+E\+\_\+\+T\+Y\+P\+E\+\_\+\+P\+C\+M16}} = 0
 \}
\begin{DoxyCompactList}\small\item\em Audio frame type. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_a6f20d335dbc3a85bfd195608165c7e00}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_a6f20d335dbc3a85bfd195608165c7e00}} 
enum \{ {\bfseries M\+A\+X\+\_\+\+H\+A\+N\+D\+L\+E\+\_\+\+T\+I\+M\+E\+\_\+\+C\+NT} = 10
 \}
\item 
enum \mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92}{A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+O\+S\+I\+T\+I\+ON}} \{ \newline
{\bfseries A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+N\+O\+NE} = 0x0000, 
\mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92a5a17c9dba2127ec59b80f58b631a53a0}{A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+P\+L\+A\+Y\+B\+A\+CK}} = 0x0001, 
\mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92a4ab55e89702612471a63fa722b6cc80a}{A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+R\+E\+C\+O\+RD}} = 0x0002, 
\mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92ab5413fc70cda2b62b290be8c9e27d52b}{A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+M\+I\+X\+ED}} = 0x0004, 
\newline
\mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92a2af303c3cc92ed4d8da5fa5f7a858665}{A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+B\+E\+F\+O\+R\+E\+\_\+\+M\+I\+X\+I\+NG}} = 0x0008, 
\mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92af2ee078f7ced9d4c9354eaf44e802ced}{A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+E\+A\+R\+\_\+\+M\+O\+N\+I\+T\+O\+R\+I\+NG}} = 0x0010
 \}
\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual bool \mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_aba6a8259228745183105c71efbab86c0}{on\+Record\+Audio\+Frame}} (const char $\ast$channel\+Id, \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{Audio\+Frame}} \&audio\+Frame)=0
\begin{DoxyCompactList}\small\item\em Gets the captured audio frame. \end{DoxyCompactList}\item 
virtual bool \mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_a4687657aed2d1702b07455aa7bdb19d7}{on\+Playback\+Audio\+Frame}} (const char $\ast$channel\+Id, \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{Audio\+Frame}} \&audio\+Frame)=0
\begin{DoxyCompactList}\small\item\em Gets the raw audio frame for playback. \end{DoxyCompactList}\item 
virtual bool \mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_aeef4ee74bbec4a46c1c67c3c07a70e6d}{on\+Mixed\+Audio\+Frame}} (const char $\ast$channel\+Id, \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{Audio\+Frame}} \&audio\+Frame)=0
\begin{DoxyCompactList}\small\item\em Retrieves the mixed captured and playback audio frame. \end{DoxyCompactList}\item 
virtual bool \mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_a8595cdf8384578b3a87973f913185bb0}{on\+Ear\+Monitoring\+Audio\+Frame}} (\mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{Audio\+Frame}} \&audio\+Frame)=0
\begin{DoxyCompactList}\small\item\em Gets the in-\/ear monitoring audio frame. \end{DoxyCompactList}\item 
virtual bool \mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_af9f96e0fb16217950c8045b54a970d90}{on\+Playback\+Audio\+Frame\+Before\+Mixing}} (const char $\ast$channel\+Id, base\+::user\+\_\+id\+\_\+t user\+Id, \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{Audio\+Frame}} \&audio\+Frame)
\item 
virtual int \mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_a0407cfd7ed343fde152ab0512448bc22}{get\+Observed\+Audio\+Frame\+Position}} ()=0
\begin{DoxyCompactList}\small\item\em Sets the frame position for the video observer. \end{DoxyCompactList}\item 
virtual \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_params}{Audio\+Params}} \mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_abbc13600d21c34d6c808cbdaf1b3b267}{get\+Playback\+Audio\+Params}} ()=0
\begin{DoxyCompactList}\small\item\em Sets the audio format for the {\ttfamily on\+Playback\+Audio\+Frame} callback. \end{DoxyCompactList}\item 
virtual \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_params}{Audio\+Params}} \mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_aedbd590f38bcdc3b4e1b15ffd2790083}{get\+Record\+Audio\+Params}} ()=0
\begin{DoxyCompactList}\small\item\em Sets the audio format for the {\ttfamily on\+Record\+Audio\+Frame} callback. \end{DoxyCompactList}\item 
virtual \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_params}{Audio\+Params}} \mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_ac933d83e266b3d7550f4e448e2816bb6}{get\+Mixed\+Audio\+Params}} ()=0
\begin{DoxyCompactList}\small\item\em Sets the audio format for the {\ttfamily on\+Mixed\+Audio\+Frame} callback. \end{DoxyCompactList}\item 
virtual \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_params}{Audio\+Params}} \mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_aca4d4ca2919dacb546d75d117025463a}{get\+Ear\+Monitoring\+Audio\+Params}} ()=0
\begin{DoxyCompactList}\small\item\em Sets the audio format for the {\ttfamily on\+Ear\+Monitoring\+Audio\+Frame} callback. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
The \mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base}{I\+Audio\+Frame\+Observer\+Base}} class. 

\doxysubsection{Member Enumeration Documentation}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_aa0e2b429cd1e9e55f60614adffa01dac}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_aa0e2b429cd1e9e55f60614adffa01dac}} 
\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}!AUDIO\_FRAME\_TYPE@{AUDIO\_FRAME\_TYPE}}
\index{AUDIO\_FRAME\_TYPE@{AUDIO\_FRAME\_TYPE}!agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}
\doxysubsubsection{\texorpdfstring{AUDIO\_FRAME\_TYPE}{AUDIO\_FRAME\_TYPE}}
{\footnotesize\ttfamily enum \mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_aa0e2b429cd1e9e55f60614adffa01dac}{agora\+::media\+::\+I\+Audio\+Frame\+Observer\+Base\+::\+A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+T\+Y\+PE}}}



Audio frame type. 

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{FRAME\_TYPE\_PCM16@{FRAME\_TYPE\_PCM16}!agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}!FRAME\_TYPE\_PCM16@{FRAME\_TYPE\_PCM16}}}\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_aa0e2b429cd1e9e55f60614adffa01daca434ef108ae62459f31354c79a4ee8d48}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_aa0e2b429cd1e9e55f60614adffa01daca434ef108ae62459f31354c79a4ee8d48}} 
F\+R\+A\+M\+E\+\_\+\+T\+Y\+P\+E\+\_\+\+P\+C\+M16&0\+: P\+CM 16 \\
\hline

\end{DoxyEnumFields}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92}} 
\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}!AUDIO\_FRAME\_POSITION@{AUDIO\_FRAME\_POSITION}}
\index{AUDIO\_FRAME\_POSITION@{AUDIO\_FRAME\_POSITION}!agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}
\doxysubsubsection{\texorpdfstring{AUDIO\_FRAME\_POSITION}{AUDIO\_FRAME\_POSITION}}
{\footnotesize\ttfamily enum \mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92}{agora\+::media\+::\+I\+Audio\+Frame\+Observer\+Base\+::\+A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+O\+S\+I\+T\+I\+ON}}}

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{AUDIO\_FRAME\_POSITION\_PLAYBACK@{AUDIO\_FRAME\_POSITION\_PLAYBACK}!agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}!AUDIO\_FRAME\_POSITION\_PLAYBACK@{AUDIO\_FRAME\_POSITION\_PLAYBACK}}}\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92a5a17c9dba2127ec59b80f58b631a53a0}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92a5a17c9dba2127ec59b80f58b631a53a0}} 
A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+P\+L\+A\+Y\+B\+A\+CK&The position for observing the playback audio of all remote users after mixing \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{AUDIO\_FRAME\_POSITION\_RECORD@{AUDIO\_FRAME\_POSITION\_RECORD}!agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}!AUDIO\_FRAME\_POSITION\_RECORD@{AUDIO\_FRAME\_POSITION\_RECORD}}}\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92a4ab55e89702612471a63fa722b6cc80a}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92a4ab55e89702612471a63fa722b6cc80a}} 
A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+R\+E\+C\+O\+RD&The position for observing the recorded audio of the local user \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{AUDIO\_FRAME\_POSITION\_MIXED@{AUDIO\_FRAME\_POSITION\_MIXED}!agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}!AUDIO\_FRAME\_POSITION\_MIXED@{AUDIO\_FRAME\_POSITION\_MIXED}}}\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92ab5413fc70cda2b62b290be8c9e27d52b}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92ab5413fc70cda2b62b290be8c9e27d52b}} 
A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+M\+I\+X\+ED&The position for observing the mixed audio of the local user and all remote users \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{AUDIO\_FRAME\_POSITION\_BEFORE\_MIXING@{AUDIO\_FRAME\_POSITION\_BEFORE\_MIXING}!agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}!AUDIO\_FRAME\_POSITION\_BEFORE\_MIXING@{AUDIO\_FRAME\_POSITION\_BEFORE\_MIXING}}}\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92a2af303c3cc92ed4d8da5fa5f7a858665}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92a2af303c3cc92ed4d8da5fa5f7a858665}} 
A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+B\+E\+F\+O\+R\+E\+\_\+\+M\+I\+X\+I\+NG&The position for observing the audio of a single remote user before mixing \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{AUDIO\_FRAME\_POSITION\_EAR\_MONITORING@{AUDIO\_FRAME\_POSITION\_EAR\_MONITORING}!agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}!AUDIO\_FRAME\_POSITION\_EAR\_MONITORING@{AUDIO\_FRAME\_POSITION\_EAR\_MONITORING}}}\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92af2ee078f7ced9d4c9354eaf44e802ced}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_aed3c9b8d1fc7a220e592d706bbbeaa92af2ee078f7ced9d4c9354eaf44e802ced}} 
A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+E\+A\+R\+\_\+\+M\+O\+N\+I\+T\+O\+R\+I\+NG&The position for observing the ear monitoring audio of the local user \\
\hline

\end{DoxyEnumFields}


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_aba6a8259228745183105c71efbab86c0}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_aba6a8259228745183105c71efbab86c0}} 
\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}!onRecordAudioFrame@{onRecordAudioFrame}}
\index{onRecordAudioFrame@{onRecordAudioFrame}!agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}
\doxysubsubsection{\texorpdfstring{onRecordAudioFrame()}{onRecordAudioFrame()}}
{\footnotesize\ttfamily virtual bool agora\+::media\+::\+I\+Audio\+Frame\+Observer\+Base\+::on\+Record\+Audio\+Frame (\begin{DoxyParamCaption}\item[{const char $\ast$}]{channel\+Id,  }\item[{\mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{Audio\+Frame}} \&}]{audio\+Frame }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Gets the captured audio frame. 

To ensure that the format of the cpatured audio frame is as expected, you can choose one of the following two methods to set the audio data format\+:
\begin{DoxyItemize}
\item Method 1\+: After calling {\ttfamily set\+Recording\+Audio\+Frame\+Parameters} to set the audio data format and {\ttfamily register\+Audio\+Frame\+Observer} to register the audio frame observer object, the S\+DK calculates the sampling interval according to the parameters set in the methods, and triggers the {\ttfamily on\+Record\+Audio\+Frame} callback according to the sampling interval.
\item Method 2\+: After calling {\ttfamily register\+Audio\+Frame\+Observer} to register the audio frame observer object, set the audio data format in the return value of the {\ttfamily get\+Observed\+Audio\+Frame\+Position} callback. The S\+DK then calculates the sampling interval according to the return value of the {\ttfamily get\+Record\+Audio\+Params} callback, and triggers the {\ttfamily on\+Record\+Audio\+Frame} callback according to the sampling interval.
\end{DoxyItemize}

\begin{DoxyNote}{Note}
The priority of method 1 is higher than that of method 2. If method 1 is used to set the audio data format, the setting of method 2 is invalid.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em audio\+Frame} & The raw audio data. See {\ttfamily \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{Audio\+Frame}}}. \\
\hline
{\em channel\+Id} & The channel ID.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Without practical meaning. 
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_a4687657aed2d1702b07455aa7bdb19d7}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_a4687657aed2d1702b07455aa7bdb19d7}} 
\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}!onPlaybackAudioFrame@{onPlaybackAudioFrame}}
\index{onPlaybackAudioFrame@{onPlaybackAudioFrame}!agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}
\doxysubsubsection{\texorpdfstring{onPlaybackAudioFrame()}{onPlaybackAudioFrame()}}
{\footnotesize\ttfamily virtual bool agora\+::media\+::\+I\+Audio\+Frame\+Observer\+Base\+::on\+Playback\+Audio\+Frame (\begin{DoxyParamCaption}\item[{const char $\ast$}]{channel\+Id,  }\item[{\mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{Audio\+Frame}} \&}]{audio\+Frame }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Gets the raw audio frame for playback. 

To ensure that the data format of audio frame for playback is as expected, Agora recommends that you choose one of the following two methods to set the audio data format\+:
\begin{DoxyItemize}
\item Method 1\+: After calling {\ttfamily set\+Playback\+Audio\+Frame\+Parameters} to set the audio data format and {\ttfamily register\+Audio\+Frame\+Observer} to register the audio frame observer object, the S\+DK calculates the sampling interval according to the parameters set in the methods, and triggers the {\ttfamily on\+Playback\+Audio\+Frame} callback according to the sampling interval.
\item Method 2\+: After calling {\ttfamily register\+Audio\+Frame\+Observer} to register the audio frame observer object, set the audio data format in the return value of the {\ttfamily get\+Observed\+Audio\+Frame\+Position} callback. The S\+DK then calculates the sampling interval according to the return value of the {\ttfamily get\+Playback\+Audio\+Params} callback, and triggers the {\ttfamily on\+Playback\+Audio\+Frame} callback according to the sampling interval.
\end{DoxyItemize}

\begin{DoxyNote}{Note}
The priority of method 1 is higher than that of method 2. If method 1 is used to set the audio data format, the setting of method 2 is invalid.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em audio\+Frame} & The raw audio data. See {\ttfamily \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{Audio\+Frame}}}. \\
\hline
{\em channel\+Id} & The channel ID.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Without practical meaning. 
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_aeef4ee74bbec4a46c1c67c3c07a70e6d}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_aeef4ee74bbec4a46c1c67c3c07a70e6d}} 
\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}!onMixedAudioFrame@{onMixedAudioFrame}}
\index{onMixedAudioFrame@{onMixedAudioFrame}!agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}
\doxysubsubsection{\texorpdfstring{onMixedAudioFrame()}{onMixedAudioFrame()}}
{\footnotesize\ttfamily virtual bool agora\+::media\+::\+I\+Audio\+Frame\+Observer\+Base\+::on\+Mixed\+Audio\+Frame (\begin{DoxyParamCaption}\item[{const char $\ast$}]{channel\+Id,  }\item[{\mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{Audio\+Frame}} \&}]{audio\+Frame }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Retrieves the mixed captured and playback audio frame. 

To ensure that the data format of mixed captured and playback audio frame meets the expectations, Agora recommends that you choose one of the following two ways to set the data format\+:
\begin{DoxyItemize}
\item Method 1\+: After calling {\ttfamily set\+Mixed\+Audio\+Frame\+Parameters} to set the audio data format and {\ttfamily register\+Audio\+Frame\+Observer} to register the audio frame observer object, the S\+DK calculates the sampling interval according to the parameters set in the methods, and triggers the {\ttfamily on\+Mixed\+Audio\+Frame} callback according to the sampling interval.
\item Method 2\+: After calling {\ttfamily register\+Audio\+Frame\+Observer} to register the audio frame observer object, set the audio data format in the return value of the {\ttfamily get\+Observed\+Audio\+Frame\+Position} callback. The S\+DK then calculates the sampling interval according to the return value of the {\ttfamily get\+Mixed\+Audio\+Params} callback, and triggers the {\ttfamily on\+Mixed\+Audio\+Frame} callback according to the sampling interval.
\end{DoxyItemize}

\begin{DoxyNote}{Note}
The priority of method 1 is higher than that of method 2. If method 1 is used to set the audio data format, the setting of method 2 is invalid.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em audio\+Frame} & The raw audio data. See {\ttfamily \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{Audio\+Frame}}}. \\
\hline
{\em channel\+Id} & The channel ID.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Without practical meaning. 
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_a8595cdf8384578b3a87973f913185bb0}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_a8595cdf8384578b3a87973f913185bb0}} 
\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}!onEarMonitoringAudioFrame@{onEarMonitoringAudioFrame}}
\index{onEarMonitoringAudioFrame@{onEarMonitoringAudioFrame}!agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}
\doxysubsubsection{\texorpdfstring{onEarMonitoringAudioFrame()}{onEarMonitoringAudioFrame()}}
{\footnotesize\ttfamily virtual bool agora\+::media\+::\+I\+Audio\+Frame\+Observer\+Base\+::on\+Ear\+Monitoring\+Audio\+Frame (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{Audio\+Frame}} \&}]{audio\+Frame }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Gets the in-\/ear monitoring audio frame. 

In order to ensure that the obtained in-\/ear audio data meets the expectations, Agora recommends that you choose one of the following two methods to set the in-\/ear monitoring-\/ear audio data format\+:
\begin{DoxyItemize}
\item Method 1\+: After calling {\ttfamily set\+Ear\+Monitoring\+Audio\+Frame\+Parameters} to set the audio data format and {\ttfamily register\+Audio\+Frame\+Observer} to register the audio frame observer object, the S\+DK calculates the sampling interval according to the parameters set in the methods, and triggers the {\ttfamily on\+Ear\+Monitoring\+Audio\+Frame} callback according to the sampling interval.
\item Method 2\+: After calling {\ttfamily register\+Audio\+Frame\+Observer} to register the audio frame observer object, set the audio data format in the return value of the {\ttfamily get\+Observed\+Audio\+Frame\+Position} callback. The S\+DK then calculates the sampling interval according to the return value of the {\ttfamily get\+Ear\+Monitoring\+Audio\+Params} callback, and triggers the {\ttfamily on\+Ear\+Monitoring\+Audio\+Frame} callback according to the sampling interval.
\end{DoxyItemize}

\begin{DoxyNote}{Note}
The priority of method 1 is higher than that of method 2. If method 1 is used to set the audio data format, the setting of method 2 is invalid.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em audio\+Frame} & The raw audio data. See {\ttfamily \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{Audio\+Frame}}}.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Without practical meaning. 
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_af9f96e0fb16217950c8045b54a970d90}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_af9f96e0fb16217950c8045b54a970d90}} 
\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}!onPlaybackAudioFrameBeforeMixing@{onPlaybackAudioFrameBeforeMixing}}
\index{onPlaybackAudioFrameBeforeMixing@{onPlaybackAudioFrameBeforeMixing}!agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}
\doxysubsubsection{\texorpdfstring{onPlaybackAudioFrameBeforeMixing()}{onPlaybackAudioFrameBeforeMixing()}}
{\footnotesize\ttfamily virtual bool agora\+::media\+::\+I\+Audio\+Frame\+Observer\+Base\+::on\+Playback\+Audio\+Frame\+Before\+Mixing (\begin{DoxyParamCaption}\item[{const char $\ast$}]{channel\+Id,  }\item[{base\+::user\+\_\+id\+\_\+t}]{user\+Id,  }\item[{\mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{Audio\+Frame}} \&}]{audio\+Frame }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}

Occurs when the before-\/mixing playback audio frame is received. 
\begin{DoxyParams}{Parameters}
{\em channel\+Id} & The channel name \\
\hline
{\em user\+Id} & ID of the remote user. \\
\hline
{\em audio\+Frame} & The reference to the audio frame\+: \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{Audio\+Frame}}. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item true\+: The before-\/mixing playback audio frame is valid and is encoded and sent.
\item false\+: The before-\/mixing playback audio frame is invalid and is not encoded or sent. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_a0407cfd7ed343fde152ab0512448bc22}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_a0407cfd7ed343fde152ab0512448bc22}} 
\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}!getObservedAudioFramePosition@{getObservedAudioFramePosition}}
\index{getObservedAudioFramePosition@{getObservedAudioFramePosition}!agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}
\doxysubsubsection{\texorpdfstring{getObservedAudioFramePosition()}{getObservedAudioFramePosition()}}
{\footnotesize\ttfamily virtual int agora\+::media\+::\+I\+Audio\+Frame\+Observer\+Base\+::get\+Observed\+Audio\+Frame\+Position (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Sets the frame position for the video observer. 

After successfully registering the audio data observer, the S\+DK uses this callback for each specific audio frame processing node to determine whether to trigger the following callbacks\+:
\begin{DoxyItemize}
\item {\ttfamily on\+Record\+Audio\+Frame}
\item {\ttfamily on\+Playback\+Audio\+Frame}
\item {\ttfamily on\+Playback\+Audio\+Frame\+Before\+Mixing}
\item {\ttfamily on\+Mixed\+Audio\+Frame}
\item {\ttfamily on\+Ear\+Monitoring\+Audio\+Frame} You can set one or more positions you need to observe by modifying the return value of {\ttfamily get\+Observed\+Audio\+Frame\+Position} based on your scenario requirements\+: When the annotation observes multiple locations, the $\vert$ (or operator) is required. To conserve system resources, you can reduce the number of frame positions that you want to observe.
\end{DoxyItemize}

\begin{DoxyReturn}{Returns}
a bitmask that sets the observation position, with the following values\+:
\begin{DoxyItemize}
\item A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+P\+L\+A\+Y\+B\+A\+CK (0x0001)\+: This position can observe the playback audio mixed by all remote users, corresponding to the {\ttfamily on\+Playback\+Audio\+Frame} callback.
\item A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+R\+E\+C\+O\+RD (0x0002)\+: This position can observe the collected local user\textquotesingle{}s audio, corresponding to the {\ttfamily on\+Record\+Audio\+Frame} callback.
\item A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+M\+I\+X\+ED (0x0004)\+: This position can observe the playback audio mixed by the loacl user and all remote users, corresponding to the {\ttfamily on\+Mixed\+Audio\+Frame} callback.
\item A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+B\+E\+F\+O\+R\+E\+\_\+\+M\+I\+X\+I\+NG (0x0008)\+: This position can observe the audio of a single remote user before mixing, corresponding to the {\ttfamily on\+Playback\+Audio\+Frame\+Before\+Mixing} callback.
\item A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+E\+A\+R\+\_\+\+M\+O\+N\+I\+T\+O\+R\+I\+NG (0x0010)\+: This position can observe the in-\/ear monitoring audio of the local user, corresponding to the {\ttfamily on\+Ear\+Monitoring\+Audio\+Frame} callback. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_abbc13600d21c34d6c808cbdaf1b3b267}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_abbc13600d21c34d6c808cbdaf1b3b267}} 
\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}!getPlaybackAudioParams@{getPlaybackAudioParams}}
\index{getPlaybackAudioParams@{getPlaybackAudioParams}!agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}
\doxysubsubsection{\texorpdfstring{getPlaybackAudioParams()}{getPlaybackAudioParams()}}
{\footnotesize\ttfamily virtual \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_params}{Audio\+Params}} agora\+::media\+::\+I\+Audio\+Frame\+Observer\+Base\+::get\+Playback\+Audio\+Params (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Sets the audio format for the {\ttfamily on\+Playback\+Audio\+Frame} callback. 

You need to register the callback when calling the {\ttfamily register\+Audio\+Frame\+Observer} method. After you successfully register the audio observer, the S\+DK triggers this callback, and you can set the audio format in the return value of this callback.

\begin{DoxyNote}{Note}
The S\+DK triggers the {\ttfamily on\+Playback\+Audio\+Frame} callback with the {\ttfamily \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_params}{Audio\+Params}}} calculated sampling interval you set in the return value. The calculation formula is Sample interval (sec) = {\ttfamily sample\+Per\+Call} /( {\ttfamily sample\+Rate} × {\ttfamily channel} ). Ensure that the sample interval ≥ 0.\+01 (s).
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
The audio data for playback, see {\ttfamily \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_params}{Audio\+Params}}}. 
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_aedbd590f38bcdc3b4e1b15ffd2790083}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_aedbd590f38bcdc3b4e1b15ffd2790083}} 
\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}!getRecordAudioParams@{getRecordAudioParams}}
\index{getRecordAudioParams@{getRecordAudioParams}!agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}
\doxysubsubsection{\texorpdfstring{getRecordAudioParams()}{getRecordAudioParams()}}
{\footnotesize\ttfamily virtual \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_params}{Audio\+Params}} agora\+::media\+::\+I\+Audio\+Frame\+Observer\+Base\+::get\+Record\+Audio\+Params (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Sets the audio format for the {\ttfamily on\+Record\+Audio\+Frame} callback. 

You need to register the callback when calling the {\ttfamily register\+Audio\+Frame\+Observer} method. After you successfully register the audio observer, the S\+DK triggers this callback, and you can set the audio format in the return value of this callback.

\begin{DoxyNote}{Note}
The S\+DK triggers the {\ttfamily on\+Record\+Audio\+Frame} callback with the {\ttfamily \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_params}{Audio\+Params}}} calculated sampling interval you set in the return value. The calculation formula is Sample interval (sec) = {\ttfamily sample\+Per\+Call} /( {\ttfamily sample\+Rate} × {\ttfamily channel} ). Ensure that the sample interval ≥ 0.\+01 (s).
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
The captured audio data, see {\ttfamily \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_params}{Audio\+Params}}}. 
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_ac933d83e266b3d7550f4e448e2816bb6}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_ac933d83e266b3d7550f4e448e2816bb6}} 
\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}!getMixedAudioParams@{getMixedAudioParams}}
\index{getMixedAudioParams@{getMixedAudioParams}!agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}
\doxysubsubsection{\texorpdfstring{getMixedAudioParams()}{getMixedAudioParams()}}
{\footnotesize\ttfamily virtual \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_params}{Audio\+Params}} agora\+::media\+::\+I\+Audio\+Frame\+Observer\+Base\+::get\+Mixed\+Audio\+Params (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Sets the audio format for the {\ttfamily on\+Mixed\+Audio\+Frame} callback. 

You need to register the callback when calling the {\ttfamily register\+Audio\+Frame\+Observer} method. After you successfully register the audio observer, the S\+DK triggers this callback, and you can set the audio format in the return value of this callback.

\begin{DoxyNote}{Note}
The S\+DK triggers the {\ttfamily on\+Mixed\+Audio\+Frame} callback with the {\ttfamily \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_params}{Audio\+Params}}} calculated sampling interval you set in the return value. The calculation formula is Sample interval (sec) = {\ttfamily sample\+Per\+Call} /( {\ttfamily sample\+Rate} × {\ttfamily channel} ). Ensure that the sample interval ≥ 0.\+01 (s).
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
The mixed captured and playback audio data. See {\ttfamily \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_params}{Audio\+Params}}}. 
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_audio_frame_observer_base_aca4d4ca2919dacb546d75d117025463a}\label{classagora_1_1media_1_1_i_audio_frame_observer_base_aca4d4ca2919dacb546d75d117025463a}} 
\index{agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}!getEarMonitoringAudioParams@{getEarMonitoringAudioParams}}
\index{getEarMonitoringAudioParams@{getEarMonitoringAudioParams}!agora::media::IAudioFrameObserverBase@{agora::media::IAudioFrameObserverBase}}
\doxysubsubsection{\texorpdfstring{getEarMonitoringAudioParams()}{getEarMonitoringAudioParams()}}
{\footnotesize\ttfamily virtual \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_params}{Audio\+Params}} agora\+::media\+::\+I\+Audio\+Frame\+Observer\+Base\+::get\+Ear\+Monitoring\+Audio\+Params (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Sets the audio format for the {\ttfamily on\+Ear\+Monitoring\+Audio\+Frame} callback. 

You need to register the callback when calling the {\ttfamily register\+Audio\+Frame\+Observer} method. After you successfully register the audio observer, the S\+DK triggers this callback, and you can set the audio format in the return value of this callback.

\begin{DoxyNote}{Note}
The S\+DK triggers the {\ttfamily on\+Ear\+Monitoring\+Audio\+Frame} callback with the {\ttfamily \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_params}{Audio\+Params}}} calculated sampling interval you set in the return value. The calculation formula is {\ttfamily Sample} interval ( {\ttfamily sec} ) = {\ttfamily sample\+Per\+Call} /( {\ttfamily sample\+Rate} × {\ttfamily channel} ). Ensure that the sample interval ≥ 0.\+01 (s).
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
The audio data of in-\/ear monitoring, see {\ttfamily \mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_params}{Audio\+Params}}}. 
\end{DoxyReturn}
