\hypertarget{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params}{}\doxysection{io.\+agora.\+rtc2.\+audio.\+Audio\+Params Class Reference}
\label{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params}\index{io.agora.rtc2.audio.AudioParams@{io.agora.rtc2.audio.AudioParams}}


Audio data format.  


\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_ac38bf20854f46c31bcc2fdd3705d4a40}\label{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_ac38bf20854f46c31bcc2fdd3705d4a40}} 
{\bfseries Audio\+Params} (int \mbox{\hyperlink{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_ace4e66c75c5a88bfa19bcfc9a45a774a}{sample\+Rate}}, int channel\+Cnt, int \mbox{\hyperlink{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_a451465f347666820681b951bd3206055}{mode}}, int \mbox{\hyperlink{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_aa73fa9418bde2223907fc8b208f4326c}{samples\+Per\+Call}})
\item 
\mbox{\Hypertarget{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_a40e55fb40a1df5291495203b2ebeda3f}\label{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_a40e55fb40a1df5291495203b2ebeda3f}} 
int {\bfseries get\+Sample\+Rate} ()
\item 
\mbox{\Hypertarget{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_abfc40fc72ebcb5e660e1f9691a356db3}\label{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_abfc40fc72ebcb5e660e1f9691a356db3}} 
int {\bfseries get\+Channel} ()
\item 
\mbox{\Hypertarget{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_ad635abcc7c4d263ecf2c9a50d1c05dc6}\label{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_ad635abcc7c4d263ecf2c9a50d1c05dc6}} 
int {\bfseries get\+Mode} ()
\item 
\mbox{\Hypertarget{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_a40639aa4319565fa1cb691d458d53e20}\label{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_a40639aa4319565fa1cb691d458d53e20}} 
int {\bfseries get\+Samples\+Per\+Call} ()
\item 
\mbox{\Hypertarget{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_a9a6fd1eaf1ad556cf5a346854f17dc79}\label{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_a9a6fd1eaf1ad556cf5a346854f17dc79}} 
String {\bfseries to\+String} ()
\end{DoxyCompactItemize}
\doxysubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
int \mbox{\hyperlink{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_ace4e66c75c5a88bfa19bcfc9a45a774a}{sample\+Rate}} = 0
\item 
int \mbox{\hyperlink{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_a857b76cfa84488160f502f36ff8c2465}{channel}} = 0
\item 
int \mbox{\hyperlink{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_a451465f347666820681b951bd3206055}{mode}} = \mbox{\hyperlink{classio_1_1agora_1_1rtc2_1_1_constants_ae6f9e30d96f2e542fb7ef99ca1f552e1}{Constants.\+R\+A\+W\+\_\+\+A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+O\+P\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+O\+N\+LY}}
\item 
int \mbox{\hyperlink{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_aa73fa9418bde2223907fc8b208f4326c}{samples\+Per\+Call}} = 0
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Audio data format. 

You can pass the {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params}{Audio\+Params}}} object in the following A\+P\+Is to set the audio data format for the corresponding callback\+:
\begin{DoxyItemize}
\item {\ttfamily get\+Record\+Audio\+Params}\+: Sets the audio data format for the {\ttfamily on\+Record\+Audio\+Frame} callback.
\item {\ttfamily get\+Playback\+Audio\+Params}\+: Sets the audio data format for the {\ttfamily on\+Playback\+Audio\+Frame} callback.
\item {\ttfamily get\+Mixed\+Audio\+Params}\+: Sets the audio data format for the {\ttfamily on\+Mixed\+Audio\+Frame} callback.
\item {\ttfamily get\+Ear\+Monitoring\+Audio\+Params}\+: Sets the audio data format for the {\ttfamily on\+Ear\+Monitoring\+Audio\+Frame} callback.
\end{DoxyItemize}

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item The S\+DK calculates the sampling interval through the {\ttfamily samples\+Per\+Call}, {\ttfamily sample\+Rate}, and {\ttfamily channel} parameters in {\ttfamily \mbox{\hyperlink{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params}{Audio\+Params}}}, and triggers the {\ttfamily on\+Record\+Audio\+Frame}, {\ttfamily on\+Playback\+Audio\+Frame}, {\ttfamily on\+Mixed\+Audio\+Frame}, and {\ttfamily on\+Ear\+Monitoring\+Audio\+Frame} callbacks according to the sampling interval.
\item Sample interval (sec) = {\ttfamily sample\+Per\+Call} /( {\ttfamily sample\+Rate} × {\ttfamily channel} ).
\item Ensure that the sample interval ≥ 0.\+01 (s). 
\end{DoxyItemize}
\end{DoxyNote}


\doxysubsection{Member Data Documentation}
\mbox{\Hypertarget{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_ace4e66c75c5a88bfa19bcfc9a45a774a}\label{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_ace4e66c75c5a88bfa19bcfc9a45a774a}} 
\index{io.agora.rtc2.audio.AudioParams@{io.agora.rtc2.audio.AudioParams}!sampleRate@{sampleRate}}
\index{sampleRate@{sampleRate}!io.agora.rtc2.audio.AudioParams@{io.agora.rtc2.audio.AudioParams}}
\doxysubsubsection{\texorpdfstring{sampleRate}{sampleRate}}
{\footnotesize\ttfamily int io.\+agora.\+rtc2.\+audio.\+Audio\+Params.\+sample\+Rate = 0}

The audio sample rate (Hz), which can be set as one of the following values\+:
\begin{DoxyItemize}
\item 8000.
\item (Default) 16000.
\item 32000.
\item 44100
\item 48000 
\end{DoxyItemize}\mbox{\Hypertarget{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_a857b76cfa84488160f502f36ff8c2465}\label{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_a857b76cfa84488160f502f36ff8c2465}} 
\index{io.agora.rtc2.audio.AudioParams@{io.agora.rtc2.audio.AudioParams}!channel@{channel}}
\index{channel@{channel}!io.agora.rtc2.audio.AudioParams@{io.agora.rtc2.audio.AudioParams}}
\doxysubsubsection{\texorpdfstring{channel}{channel}}
{\footnotesize\ttfamily int io.\+agora.\+rtc2.\+audio.\+Audio\+Params.\+channel = 0}

The number of audio channels, which can be set as either of the following values\+:
\begin{DoxyItemize}
\item 1\+: (Default) Mono.
\item 2\+: Stereo. 
\end{DoxyItemize}\mbox{\Hypertarget{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_a451465f347666820681b951bd3206055}\label{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_a451465f347666820681b951bd3206055}} 
\index{io.agora.rtc2.audio.AudioParams@{io.agora.rtc2.audio.AudioParams}!mode@{mode}}
\index{mode@{mode}!io.agora.rtc2.audio.AudioParams@{io.agora.rtc2.audio.AudioParams}}
\doxysubsubsection{\texorpdfstring{mode}{mode}}
{\footnotesize\ttfamily int io.\+agora.\+rtc2.\+audio.\+Audio\+Params.\+mode = \mbox{\hyperlink{classio_1_1agora_1_1rtc2_1_1_constants_ae6f9e30d96f2e542fb7ef99ca1f552e1}{Constants.\+R\+A\+W\+\_\+\+A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+O\+P\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+O\+N\+LY}}}

The use mode of the audio data, which can be set as either of the following values\+:
\begin{DoxyItemize}
\item R\+A\+W\+\_\+\+A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+O\+P\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+O\+N\+LY (0)\+: Read-\/only mode, For example, when users acquire the data with the Agora S\+DK, then start the media push.
\item R\+A\+W\+\_\+\+A\+U\+D\+I\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+O\+P\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+W\+R\+I\+TE (2)\+: Read and write mode, For example, when users have their own audio-\/effect processing module and perform some voice pre-\/processing, such as a voice change. 
\end{DoxyItemize}\mbox{\Hypertarget{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_aa73fa9418bde2223907fc8b208f4326c}\label{classio_1_1agora_1_1rtc2_1_1audio_1_1_audio_params_aa73fa9418bde2223907fc8b208f4326c}} 
\index{io.agora.rtc2.audio.AudioParams@{io.agora.rtc2.audio.AudioParams}!samplesPerCall@{samplesPerCall}}
\index{samplesPerCall@{samplesPerCall}!io.agora.rtc2.audio.AudioParams@{io.agora.rtc2.audio.AudioParams}}
\doxysubsubsection{\texorpdfstring{samplesPerCall}{samplesPerCall}}
{\footnotesize\ttfamily int io.\+agora.\+rtc2.\+audio.\+Audio\+Params.\+samples\+Per\+Call = 0}

The number of samples, such as 1024 for the media push. 