\hypertarget{classagora_1_1media_1_1_i_media_engine}{}\doxysection{agora\+::media\+::I\+Media\+Engine Class Reference}
\label{classagora_1_1media_1_1_i_media_engine}\index{agora::media::IMediaEngine@{agora::media::IMediaEngine}}


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

\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual int \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine_ae46ca0d20789787aaab2fb268a524100}{register\+Audio\+Frame\+Observer}} (\mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer}{I\+Audio\+Frame\+Observer}} $\ast$observer)=0
\item 
virtual int \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine_a5eee4dfd1fd46e4a865feba163f3c5de}{register\+Video\+Frame\+Observer}} (\mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer}{I\+Video\+Frame\+Observer}} $\ast$observer)=0
\item 
virtual int \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine_a3f18b30ad8b5332bcee99c2146876c83}{register\+Video\+Encoded\+Frame\+Observer}} (\mbox{\hyperlink{classagora_1_1media_1_1_i_video_encoded_frame_observer}{I\+Video\+Encoded\+Frame\+Observer}} $\ast$observer)=0
\item 
virtual int \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine_a373016642bf01cf22004522da6c36789}{register\+Face\+Info\+Observer}} (\mbox{\hyperlink{classagora_1_1media_1_1_i_face_info_observer}{I\+Face\+Info\+Observer}} $\ast$observer)=0
\item 
virtual int \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine_a880ff35d3559a15965aa55837b05579a}{push\+Audio\+Frame}} (\mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{I\+Audio\+Frame\+Observer\+Base\+::\+Audio\+Frame}} $\ast$frame, rtc\+::track\+\_\+id\+\_\+t track\+Id=0)=0
\item 
virtual int \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine_ab40a4f31f73f3a775a5ea18dfeb25479}{pull\+Audio\+Frame}} (\mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{I\+Audio\+Frame\+Observer\+Base\+::\+Audio\+Frame}} $\ast$frame)=0
\item 
virtual int \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine_a334e09a78fbdeb7cee691b15afa38b53}{set\+External\+Video\+Source}} (bool enabled, bool use\+Texture, E\+X\+T\+E\+R\+N\+A\+L\+\_\+\+V\+I\+D\+E\+O\+\_\+\+S\+O\+U\+R\+C\+E\+\_\+\+T\+Y\+PE source\+Type=V\+I\+D\+E\+O\+\_\+\+F\+R\+A\+ME, \mbox{\hyperlink{structagora_1_1rtc_1_1_sender_options}{rtc\+::\+Sender\+Options}} encoded\+Video\+Option=\mbox{\hyperlink{structagora_1_1rtc_1_1_sender_options}{rtc\+::\+Sender\+Options}}())=0
\item 
virtual int \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine_a9d8ffc684390f54f2258ddad1a8b69c8}{set\+External\+Audio\+Source}} (bool enabled, int sample\+Rate, int channels, bool local\+Playback=false, bool publish=true) \+\_\+\+\_\+deprecated=0
\item 
virtual rtc\+::track\+\_\+id\+\_\+t \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine_adb9b0203cf06756db5357ea806058ab0}{create\+Custom\+Audio\+Track}} (rtc\+::\+A\+U\+D\+I\+O\+\_\+\+T\+R\+A\+C\+K\+\_\+\+T\+Y\+PE track\+Type, const \mbox{\hyperlink{structagora_1_1rtc_1_1_audio_track_config}{rtc\+::\+Audio\+Track\+Config}} \&config)=0
\item 
virtual int \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine_a11110e2c6005ef61b929198aedb9076d}{destroy\+Custom\+Audio\+Track}} (rtc\+::track\+\_\+id\+\_\+t track\+Id)=0
\item 
virtual int \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine_a82123ecb70f84c772ef84fa4ee16fba9}{set\+External\+Audio\+Sink}} (bool enabled, int sample\+Rate, int channels)=0
\item 
virtual int \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine_aed022bc54436117acc5cd3e1fffc2bba}{enable\+Custom\+Audio\+Local\+Playback}} (rtc\+::track\+\_\+id\+\_\+t track\+Id, bool enabled)=0
\item 
virtual int \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine_a3e847e920dcdb1f5c61cfdbb86f4f7c4}{push\+Video\+Frame}} (\mbox{\hyperlink{structagora_1_1media_1_1base_1_1_external_video_frame}{base\+::\+External\+Video\+Frame}} $\ast$frame, unsigned int video\+Track\+Id=0)=0
\item 
virtual int \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine_ae2b717dafdf9245d70caf5a2ecd2f9be}{push\+Encoded\+Video\+Image}} (const unsigned char $\ast$image\+Buffer, size\+\_\+t length, const \mbox{\hyperlink{structagora_1_1rtc_1_1_encoded_video_frame_info}{agora\+::rtc\+::\+Encoded\+Video\+Frame\+Info}} \&video\+Encoded\+Frame\+Info, unsigned int video\+Track\+Id=0)=0
\item 
virtual int \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine_a17df8dbc9b56bf4ecd8cac32a7b0bb2a}{add\+Video\+Frame\+Renderer}} (\mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer}{I\+Video\+Frame\+Observer}} $\ast$renderer)=0
\item 
virtual int \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine_a3a41f7d0bc2ce4d3461113b9cccba336}{remove\+Video\+Frame\+Renderer}} (\mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer}{I\+Video\+Frame\+Observer}} $\ast$renderer)=0
\item 
\mbox{\Hypertarget{classagora_1_1media_1_1_i_media_engine_affbdaa2ba63c318b382f551f0e466224}\label{classagora_1_1media_1_1_i_media_engine_affbdaa2ba63c318b382f551f0e466224}} 
virtual void {\bfseries release} ()=0
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
The \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine}{I\+Media\+Engine}} class. 

\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_media_engine_ae46ca0d20789787aaab2fb268a524100}\label{classagora_1_1media_1_1_i_media_engine_ae46ca0d20789787aaab2fb268a524100}} 
\index{agora::media::IMediaEngine@{agora::media::IMediaEngine}!registerAudioFrameObserver@{registerAudioFrameObserver}}
\index{registerAudioFrameObserver@{registerAudioFrameObserver}!agora::media::IMediaEngine@{agora::media::IMediaEngine}}
\doxysubsubsection{\texorpdfstring{registerAudioFrameObserver()}{registerAudioFrameObserver()}}
{\footnotesize\ttfamily virtual int agora\+::media\+::\+I\+Media\+Engine\+::register\+Audio\+Frame\+Observer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer}{I\+Audio\+Frame\+Observer}} $\ast$}]{observer }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Registers an audio frame observer object.

\begin{DoxyNote}{Note}
Ensure that you call this method before join\+Channel.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em observer} & A pointer to the audio frame observer object\+: \mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer}{I\+Audio\+Frame\+Observer}}, nullptr means unregistering observer instead. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_media_engine_a5eee4dfd1fd46e4a865feba163f3c5de}\label{classagora_1_1media_1_1_i_media_engine_a5eee4dfd1fd46e4a865feba163f3c5de}} 
\index{agora::media::IMediaEngine@{agora::media::IMediaEngine}!registerVideoFrameObserver@{registerVideoFrameObserver}}
\index{registerVideoFrameObserver@{registerVideoFrameObserver}!agora::media::IMediaEngine@{agora::media::IMediaEngine}}
\doxysubsubsection{\texorpdfstring{registerVideoFrameObserver()}{registerVideoFrameObserver()}}
{\footnotesize\ttfamily virtual int agora\+::media\+::\+I\+Media\+Engine\+::register\+Video\+Frame\+Observer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer}{I\+Video\+Frame\+Observer}} $\ast$}]{observer }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Registers a video frame observer object.

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item Ensure that you call this method before joining the channel.
\item If you register an observer for video raw video data, you cannot register an \mbox{\hyperlink{classagora_1_1media_1_1_i_video_encoded_frame_observer}{I\+Video\+Encoded\+Frame\+Observer}} object.
\end{DoxyItemize}
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em observer} & A pointer to the video frame observer\+: \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer}{I\+Video\+Frame\+Observer}}. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_media_engine_a3f18b30ad8b5332bcee99c2146876c83}\label{classagora_1_1media_1_1_i_media_engine_a3f18b30ad8b5332bcee99c2146876c83}} 
\index{agora::media::IMediaEngine@{agora::media::IMediaEngine}!registerVideoEncodedFrameObserver@{registerVideoEncodedFrameObserver}}
\index{registerVideoEncodedFrameObserver@{registerVideoEncodedFrameObserver}!agora::media::IMediaEngine@{agora::media::IMediaEngine}}
\doxysubsubsection{\texorpdfstring{registerVideoEncodedFrameObserver()}{registerVideoEncodedFrameObserver()}}
{\footnotesize\ttfamily virtual int agora\+::media\+::\+I\+Media\+Engine\+::register\+Video\+Encoded\+Frame\+Observer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classagora_1_1media_1_1_i_video_encoded_frame_observer}{I\+Video\+Encoded\+Frame\+Observer}} $\ast$}]{observer }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Registers a receiver object for the encoded video image.

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item Ensure that you call this method before joining the channel.
\end{DoxyItemize}
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em observer} & A pointer to the observer of the encoded video image\+: \mbox{\hyperlink{classagora_1_1media_1_1_i_video_encoded_frame_observer}{I\+Video\+Encoded\+Frame\+Observer}}.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_media_engine_a373016642bf01cf22004522da6c36789}\label{classagora_1_1media_1_1_i_media_engine_a373016642bf01cf22004522da6c36789}} 
\index{agora::media::IMediaEngine@{agora::media::IMediaEngine}!registerFaceInfoObserver@{registerFaceInfoObserver}}
\index{registerFaceInfoObserver@{registerFaceInfoObserver}!agora::media::IMediaEngine@{agora::media::IMediaEngine}}
\doxysubsubsection{\texorpdfstring{registerFaceInfoObserver()}{registerFaceInfoObserver()}}
{\footnotesize\ttfamily virtual int agora\+::media\+::\+I\+Media\+Engine\+::register\+Face\+Info\+Observer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classagora_1_1media_1_1_i_face_info_observer}{I\+Face\+Info\+Observer}} $\ast$}]{observer }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Registers a face info observer object.

\begin{DoxyNote}{Note}
Ensure that you call this method before join\+Channel.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em observer} & A pointer to the face info observer object\+: \mbox{\hyperlink{classagora_1_1media_1_1_i_face_info_observer}{I\+Face\+Info\+Observer}}.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_media_engine_a880ff35d3559a15965aa55837b05579a}\label{classagora_1_1media_1_1_i_media_engine_a880ff35d3559a15965aa55837b05579a}} 
\index{agora::media::IMediaEngine@{agora::media::IMediaEngine}!pushAudioFrame@{pushAudioFrame}}
\index{pushAudioFrame@{pushAudioFrame}!agora::media::IMediaEngine@{agora::media::IMediaEngine}}
\doxysubsubsection{\texorpdfstring{pushAudioFrame()}{pushAudioFrame()}}
{\footnotesize\ttfamily virtual int agora\+::media\+::\+I\+Media\+Engine\+::push\+Audio\+Frame (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{I\+Audio\+Frame\+Observer\+Base\+::\+Audio\+Frame}} $\ast$}]{frame,  }\item[{rtc\+::track\+\_\+id\+\_\+t}]{track\+Id = {\ttfamily 0} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Pushes the external audio data to the app.


\begin{DoxyParams}{Parameters}
{\em frame} & The audio buffer data. \\
\hline
{\em track\+Id} & The audio track ID. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_media_engine_ab40a4f31f73f3a775a5ea18dfeb25479}\label{classagora_1_1media_1_1_i_media_engine_ab40a4f31f73f3a775a5ea18dfeb25479}} 
\index{agora::media::IMediaEngine@{agora::media::IMediaEngine}!pullAudioFrame@{pullAudioFrame}}
\index{pullAudioFrame@{pullAudioFrame}!agora::media::IMediaEngine@{agora::media::IMediaEngine}}
\doxysubsubsection{\texorpdfstring{pullAudioFrame()}{pullAudioFrame()}}
{\footnotesize\ttfamily virtual int agora\+::media\+::\+I\+Media\+Engine\+::pull\+Audio\+Frame (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structagora_1_1media_1_1_i_audio_frame_observer_base_1_1_audio_frame}{I\+Audio\+Frame\+Observer\+Base\+::\+Audio\+Frame}} $\ast$}]{frame }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Pulls the remote audio data.

After a successful method call, the app pulls the decoded and mixed audio data for playback.

The difference between this method and the on\+Playback\+Audio\+Frame is as follows\+:
\begin{DoxyItemize}
\item {\ttfamily on\+Playback\+Audio\+Frame}\+: The S\+DK sends the audio data to the app once every 10 ms. Any delay in processing the audio frames may result in audio jitter.
\item {\ttfamily pull\+Audio\+Frame}\+: The app pulls the remote audio data. After setting the audio data parameters, the S\+DK adjusts the frame buffer and avoids problems caused by jitter in the external audio playback.
\end{DoxyItemize}


\begin{DoxyParams}{Parameters}
{\em frame} & The pointer to the audio frame\+: Audio\+Frame. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_media_engine_a334e09a78fbdeb7cee691b15afa38b53}\label{classagora_1_1media_1_1_i_media_engine_a334e09a78fbdeb7cee691b15afa38b53}} 
\index{agora::media::IMediaEngine@{agora::media::IMediaEngine}!setExternalVideoSource@{setExternalVideoSource}}
\index{setExternalVideoSource@{setExternalVideoSource}!agora::media::IMediaEngine@{agora::media::IMediaEngine}}
\doxysubsubsection{\texorpdfstring{setExternalVideoSource()}{setExternalVideoSource()}}
{\footnotesize\ttfamily virtual int agora\+::media\+::\+I\+Media\+Engine\+::set\+External\+Video\+Source (\begin{DoxyParamCaption}\item[{bool}]{enabled,  }\item[{bool}]{use\+Texture,  }\item[{E\+X\+T\+E\+R\+N\+A\+L\+\_\+\+V\+I\+D\+E\+O\+\_\+\+S\+O\+U\+R\+C\+E\+\_\+\+T\+Y\+PE}]{source\+Type = {\ttfamily VIDEO\+\_\+FRAME},  }\item[{\mbox{\hyperlink{structagora_1_1rtc_1_1_sender_options}{rtc\+::\+Sender\+Options}}}]{encoded\+Video\+Option = {\ttfamily \mbox{\hyperlink{structagora_1_1rtc_1_1_sender_options}{rtc\+::\+Sender\+Options}}()} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Sets the external video source.

Once the external video source is enabled, the S\+DK prepares to accept the external video frame.


\begin{DoxyParams}{Parameters}
{\em enabled} & Determines whether to enable the external video source.
\begin{DoxyItemize}
\item true\+: Enable the external video source. Once set, the S\+DK creates the external source and prepares video data from {\ttfamily push\+Video\+Frame} or {\ttfamily push\+Encoded\+Video\+Image}.
\item false\+: Disable the external video source. 
\end{DoxyItemize}\\
\hline
{\em use\+Texture} & Determines whether to use textured video data.
\begin{DoxyItemize}
\item true\+: Use texture, which is not supported now.
\item False\+: Do not use texture. 
\end{DoxyItemize}\\
\hline
{\em source\+Type} & Determines the type of external video source frame.
\begin{DoxyItemize}
\item E\+N\+C\+O\+D\+E\+D\+\_\+\+V\+I\+D\+E\+O\+\_\+\+F\+R\+A\+ME\+: The external video source is encoded.
\item V\+I\+D\+E\+O\+\_\+\+F\+R\+A\+ME\+: The external video source is not encoded. 
\end{DoxyItemize}\\
\hline
{\em encoded\+Video\+Option} & Video encoded track option, which is only used for E\+N\+C\+O\+D\+E\+D\+\_\+\+V\+I\+D\+E\+O\+\_\+\+F\+R\+A\+ME. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_media_engine_a9d8ffc684390f54f2258ddad1a8b69c8}\label{classagora_1_1media_1_1_i_media_engine_a9d8ffc684390f54f2258ddad1a8b69c8}} 
\index{agora::media::IMediaEngine@{agora::media::IMediaEngine}!setExternalAudioSource@{setExternalAudioSource}}
\index{setExternalAudioSource@{setExternalAudioSource}!agora::media::IMediaEngine@{agora::media::IMediaEngine}}
\doxysubsubsection{\texorpdfstring{setExternalAudioSource()}{setExternalAudioSource()}}
{\footnotesize\ttfamily virtual int agora\+::media\+::\+I\+Media\+Engine\+::set\+External\+Audio\+Source (\begin{DoxyParamCaption}\item[{bool}]{enabled,  }\item[{int}]{sample\+Rate,  }\item[{int}]{channels,  }\item[{bool}]{local\+Playback = {\ttfamily false},  }\item[{bool}]{publish = {\ttfamily true} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Sets the external audio source.

\begin{DoxyNote}{Note}
Ensure that you call this method before joining the channel.
\end{DoxyNote}
\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000015}{Deprecated}}]This method is deprecated. Use \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine_adb9b0203cf06756db5357ea806058ab0}{create\+Custom\+Audio\+Track(rtc\+::\+A\+U\+D\+I\+O\+\_\+\+T\+R\+A\+C\+K\+\_\+\+T\+Y\+P\+E track\+Type, const rtc\+::\+Audio\+Track\+Config\& config)}} instead.\end{DoxyRefDesc}



\begin{DoxyParams}{Parameters}
{\em enabled} & Determines whether to enable the external audio source\+:
\begin{DoxyItemize}
\item true\+: Enable the external audio source.
\item false\+: (default) Disable the external audio source. 
\end{DoxyItemize}\\
\hline
{\em sample\+Rate} & The Sample rate (Hz) of the external audio source, which can set be as 8000, 16000, 32000, 44100, or 48000. \\
\hline
{\em channels} & The number of channels of the external audio source, which can be set as 1 or 2\+:
\begin{DoxyItemize}
\item 1\+: Mono.
\item 2\+: Stereo. 
\end{DoxyItemize}\\
\hline
{\em local\+Playback} & Enable/\+Disables the local playback of external audio track\+:
\begin{DoxyItemize}
\item true\+: Enable local playback
\item false\+: (Default) Do not enable local playback 
\end{DoxyItemize}\\
\hline
{\em publish} & Determines whether to publish the external audio track\+:
\begin{DoxyItemize}
\item true\+: (Default) Publish the external audio track.
\item false\+: Don\`{}t publish the external audio track. 
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_media_engine_adb9b0203cf06756db5357ea806058ab0}\label{classagora_1_1media_1_1_i_media_engine_adb9b0203cf06756db5357ea806058ab0}} 
\index{agora::media::IMediaEngine@{agora::media::IMediaEngine}!createCustomAudioTrack@{createCustomAudioTrack}}
\index{createCustomAudioTrack@{createCustomAudioTrack}!agora::media::IMediaEngine@{agora::media::IMediaEngine}}
\doxysubsubsection{\texorpdfstring{createCustomAudioTrack()}{createCustomAudioTrack()}}
{\footnotesize\ttfamily virtual rtc\+::track\+\_\+id\+\_\+t agora\+::media\+::\+I\+Media\+Engine\+::create\+Custom\+Audio\+Track (\begin{DoxyParamCaption}\item[{rtc\+::\+A\+U\+D\+I\+O\+\_\+\+T\+R\+A\+C\+K\+\_\+\+T\+Y\+PE}]{track\+Type,  }\item[{const \mbox{\hyperlink{structagora_1_1rtc_1_1_audio_track_config}{rtc\+::\+Audio\+Track\+Config}} \&}]{config }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Create a custom audio track and get the audio track id.

\begin{DoxyNote}{Note}
Ensure that you call this method before calling {\ttfamily join\+Channel}.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em track\+Type} & The type of custom audio track See A\+U\+D\+I\+O\+\_\+\+T\+R\+A\+C\+K\+\_\+\+T\+Y\+PE.\\
\hline
{\em config} & The config of custom audio track See Audio\+Track\+Config.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item If the call is successful, S\+DK returns audio track id.
\item If the call fails, S\+DK returns 0xffffffff. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_media_engine_a11110e2c6005ef61b929198aedb9076d}\label{classagora_1_1media_1_1_i_media_engine_a11110e2c6005ef61b929198aedb9076d}} 
\index{agora::media::IMediaEngine@{agora::media::IMediaEngine}!destroyCustomAudioTrack@{destroyCustomAudioTrack}}
\index{destroyCustomAudioTrack@{destroyCustomAudioTrack}!agora::media::IMediaEngine@{agora::media::IMediaEngine}}
\doxysubsubsection{\texorpdfstring{destroyCustomAudioTrack()}{destroyCustomAudioTrack()}}
{\footnotesize\ttfamily virtual int agora\+::media\+::\+I\+Media\+Engine\+::destroy\+Custom\+Audio\+Track (\begin{DoxyParamCaption}\item[{rtc\+::track\+\_\+id\+\_\+t}]{track\+Id }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Destroy custom audio track by track\+Id


\begin{DoxyParams}{Parameters}
{\em track\+Id} & The custom audio track id.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_media_engine_a82123ecb70f84c772ef84fa4ee16fba9}\label{classagora_1_1media_1_1_i_media_engine_a82123ecb70f84c772ef84fa4ee16fba9}} 
\index{agora::media::IMediaEngine@{agora::media::IMediaEngine}!setExternalAudioSink@{setExternalAudioSink}}
\index{setExternalAudioSink@{setExternalAudioSink}!agora::media::IMediaEngine@{agora::media::IMediaEngine}}
\doxysubsubsection{\texorpdfstring{setExternalAudioSink()}{setExternalAudioSink()}}
{\footnotesize\ttfamily virtual int agora\+::media\+::\+I\+Media\+Engine\+::set\+External\+Audio\+Sink (\begin{DoxyParamCaption}\item[{bool}]{enabled,  }\item[{int}]{sample\+Rate,  }\item[{int}]{channels }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Sets the external audio sink.

This method applies to scenarios where you want to use external audio data for playback. After calling the initialize method and pass value of false in the {\ttfamily enable\+Audio\+Device} member in the Rtc\+Engine\+Context struct, you can call the \mbox{\hyperlink{classagora_1_1media_1_1_i_media_engine_ab40a4f31f73f3a775a5ea18dfeb25479}{pull\+Audio\+Frame}} method to pull the remote audio data, process it, and play it with the audio effects that you want.

\begin{DoxyNote}{Note}
Once you call the initialize method and pass value of false in the {\ttfamily enable\+Audio\+Device} member in the Rtc\+Engine\+Context struct, the app will not retrieve any audio data from the \mbox{\hyperlink{classagora_1_1media_1_1_i_audio_frame_observer_base_a4687657aed2d1702b07455aa7bdb19d7}{on\+Playback\+Audio\+Frame}} callback.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em enabled} & Sets whether or not to the external audio sink
\begin{DoxyItemize}
\item true\+: Enables the external audio sink.
\item false\+: Disables the external audio sink. 
\end{DoxyItemize}\\
\hline
{\em sample\+Rate} & Sets the sample rate (Hz) of the external audio sink, which can be set as 16000, 32000, 44100 or 48000. \\
\hline
{\em channels} & Sets the number of audio channels of the external audio sink\+:
\begin{DoxyItemize}
\item 1\+: Mono.
\item 2\+: Stereo.
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_media_engine_aed022bc54436117acc5cd3e1fffc2bba}\label{classagora_1_1media_1_1_i_media_engine_aed022bc54436117acc5cd3e1fffc2bba}} 
\index{agora::media::IMediaEngine@{agora::media::IMediaEngine}!enableCustomAudioLocalPlayback@{enableCustomAudioLocalPlayback}}
\index{enableCustomAudioLocalPlayback@{enableCustomAudioLocalPlayback}!agora::media::IMediaEngine@{agora::media::IMediaEngine}}
\doxysubsubsection{\texorpdfstring{enableCustomAudioLocalPlayback()}{enableCustomAudioLocalPlayback()}}
{\footnotesize\ttfamily virtual int agora\+::media\+::\+I\+Media\+Engine\+::enable\+Custom\+Audio\+Local\+Playback (\begin{DoxyParamCaption}\item[{rtc\+::track\+\_\+id\+\_\+t}]{track\+Id,  }\item[{bool}]{enabled }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Sets the external audio track.

\begin{DoxyNote}{Note}
Ensure that you call this method before joining the channel.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em track\+Id} & The custom audio track id. \\
\hline
{\em enabled} & Enable/\+Disables the local playback of external audio track\+:
\begin{DoxyItemize}
\item true\+: Enable local playback
\item false\+: Do not enable local playback 
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_media_engine_a3e847e920dcdb1f5c61cfdbb86f4f7c4}\label{classagora_1_1media_1_1_i_media_engine_a3e847e920dcdb1f5c61cfdbb86f4f7c4}} 
\index{agora::media::IMediaEngine@{agora::media::IMediaEngine}!pushVideoFrame@{pushVideoFrame}}
\index{pushVideoFrame@{pushVideoFrame}!agora::media::IMediaEngine@{agora::media::IMediaEngine}}
\doxysubsubsection{\texorpdfstring{pushVideoFrame()}{pushVideoFrame()}}
{\footnotesize\ttfamily virtual int agora\+::media\+::\+I\+Media\+Engine\+::push\+Video\+Frame (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structagora_1_1media_1_1base_1_1_external_video_frame}{base\+::\+External\+Video\+Frame}} $\ast$}]{frame,  }\item[{unsigned int}]{video\+Track\+Id = {\ttfamily 0} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Pushes the external video frame to the app.


\begin{DoxyParams}{Parameters}
{\em frame} & The external video frame\+: External\+Video\+Frame. \\
\hline
{\em video\+Track\+Id} & The id of the video track.
\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_media_engine_ae2b717dafdf9245d70caf5a2ecd2f9be}\label{classagora_1_1media_1_1_i_media_engine_ae2b717dafdf9245d70caf5a2ecd2f9be}} 
\index{agora::media::IMediaEngine@{agora::media::IMediaEngine}!pushEncodedVideoImage@{pushEncodedVideoImage}}
\index{pushEncodedVideoImage@{pushEncodedVideoImage}!agora::media::IMediaEngine@{agora::media::IMediaEngine}}
\doxysubsubsection{\texorpdfstring{pushEncodedVideoImage()}{pushEncodedVideoImage()}}
{\footnotesize\ttfamily virtual int agora\+::media\+::\+I\+Media\+Engine\+::push\+Encoded\+Video\+Image (\begin{DoxyParamCaption}\item[{const unsigned char $\ast$}]{image\+Buffer,  }\item[{size\+\_\+t}]{length,  }\item[{const \mbox{\hyperlink{structagora_1_1rtc_1_1_encoded_video_frame_info}{agora\+::rtc\+::\+Encoded\+Video\+Frame\+Info}} \&}]{video\+Encoded\+Frame\+Info,  }\item[{unsigned int}]{video\+Track\+Id = {\ttfamily 0} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Pushes the encoded video image to the app. 
\begin{DoxyParams}{Parameters}
{\em image\+Buffer} & A pointer to the video image. \\
\hline
{\em length} & The data length. \\
\hline
{\em video\+Encoded\+Frame\+Info} & The reference to the information of the encoded video frame\+: \mbox{\hyperlink{structagora_1_1rtc_1_1_encoded_video_frame_info}{Encoded\+Video\+Frame\+Info}}. \\
\hline
{\em video\+Track\+Id} & The id of the video track.
\begin{DoxyItemize}
\item 0\+: Success.
\item $<$ 0\+: Failure. 
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_media_engine_a17df8dbc9b56bf4ecd8cac32a7b0bb2a}\label{classagora_1_1media_1_1_i_media_engine_a17df8dbc9b56bf4ecd8cac32a7b0bb2a}} 
\index{agora::media::IMediaEngine@{agora::media::IMediaEngine}!addVideoFrameRenderer@{addVideoFrameRenderer}}
\index{addVideoFrameRenderer@{addVideoFrameRenderer}!agora::media::IMediaEngine@{agora::media::IMediaEngine}}
\doxysubsubsection{\texorpdfstring{addVideoFrameRenderer()}{addVideoFrameRenderer()}}
{\footnotesize\ttfamily virtual int agora\+::media\+::\+I\+Media\+Engine\+::add\+Video\+Frame\+Renderer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer}{I\+Video\+Frame\+Observer}} $\ast$}]{renderer }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

@hide For internal usage only \mbox{\Hypertarget{classagora_1_1media_1_1_i_media_engine_a3a41f7d0bc2ce4d3461113b9cccba336}\label{classagora_1_1media_1_1_i_media_engine_a3a41f7d0bc2ce4d3461113b9cccba336}} 
\index{agora::media::IMediaEngine@{agora::media::IMediaEngine}!removeVideoFrameRenderer@{removeVideoFrameRenderer}}
\index{removeVideoFrameRenderer@{removeVideoFrameRenderer}!agora::media::IMediaEngine@{agora::media::IMediaEngine}}
\doxysubsubsection{\texorpdfstring{removeVideoFrameRenderer()}{removeVideoFrameRenderer()}}
{\footnotesize\ttfamily virtual int agora\+::media\+::\+I\+Media\+Engine\+::remove\+Video\+Frame\+Renderer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer}{I\+Video\+Frame\+Observer}} $\ast$}]{renderer }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

@hide For internal usage only 