\hypertarget{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player}{}\doxysection{io.\+agora.\+musiccontentcenter.\+I\+Agora\+Music\+Player Interface Reference}
\label{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player}\index{io.agora.musiccontentcenter.IAgoraMusicPlayer@{io.agora.musiccontentcenter.IAgoraMusicPlayer}}
Inheritance diagram for io.\+agora.\+musiccontentcenter.\+I\+Agora\+Music\+Player\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player}
\end{center}
\end{figure}
\doxysubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
enum \mbox{\hyperlink{enumio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_1_1_music_play_mode}{Music\+Play\+Mode}}
\begin{DoxyCompactList}\small\item\em Playback modes for music resources. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a766615a4b17a22116127cb99acc2ef70}{open}} (long song\+Code, long start\+Pos)
\begin{DoxyCompactList}\small\item\em Opens a music resource by its resource ID. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a1343b2784c28e3376d6295892cd5ea72}{open}} (String url, long start\+Pos)
\begin{DoxyCompactList}\small\item\em Opens a music resource via U\+RL. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a517b16cb2a82ba4029f83a65bbbb33d0}{destroy}} ()
\begin{DoxyCompactList}\small\item\em Destroys the music player. \end{DoxyCompactList}\item 
String \mbox{\hyperlink{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_af3e3f9bec20134445a680dd2e91fa241}{get\+Play\+Src}} ()
\begin{DoxyCompactList}\small\item\em Gets the identifier or U\+RL of the currently playing music resource. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a1908d845c34b464a3531cc02ccc85b8d}{stop}} ()
\begin{DoxyCompactList}\small\item\em Stops playing the music resource. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a9a11bce8b91167e85e2d34a8a6513ab1}{set\+Play\+Mode}} (\mbox{\hyperlink{enumio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_1_1_music_play_mode}{Music\+Play\+Mode}} mode)
\begin{DoxyCompactList}\small\item\em Sets the playback mode for a music track. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a766615a4b17a22116127cb99acc2ef70}\label{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a766615a4b17a22116127cb99acc2ef70}} 
\index{io.agora.musiccontentcenter.IAgoraMusicPlayer@{io.agora.musiccontentcenter.IAgoraMusicPlayer}!open@{open}}
\index{open@{open}!io.agora.musiccontentcenter.IAgoraMusicPlayer@{io.agora.musiccontentcenter.IAgoraMusicPlayer}}
\doxysubsubsection{\texorpdfstring{open()}{open()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily int io.\+agora.\+musiccontentcenter.\+I\+Agora\+Music\+Player.\+open (\begin{DoxyParamCaption}\item[{long}]{song\+Code,  }\item[{long}]{start\+Pos }\end{DoxyParamCaption})}



Opens a music resource by its resource ID. 

Before calling this method, make sure the music resource you want to play has been fully loaded. You can call the {\ttfamily is\+Preloaded} method to check whether the music resource has been preloaded, or listen for the {\ttfamily on\+Pre\+Load\+Event} callback. After calling this method, the {\ttfamily on\+Player\+State\+Changed} callback will be triggered. Once you receive a playback state report of {\ttfamily P\+L\+A\+Y\+E\+R\+\_\+\+S\+T\+A\+T\+E\+\_\+\+O\+P\+E\+N\+\_\+\+C\+O\+M\+P\+L\+E\+T\+ED}, you can call the {\ttfamily play} method to play the media file.

\begin{DoxyNote}{Note}
If the music resource you want to open is protected by digital rights management, you must use this method to open it. For music resources that are not protected by digital rights management, you can choose to open them using either this method or the {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a1343b2784c28e3376d6295892cd5ea72}{open(\+String url, long start\+Pos)}}} method in the {\ttfamily I\+Media\+Player} class.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em song\+Code} & The resource ID of the music resource, used to identify the music. \\
\hline
{\em start\+Pos} & The starting playback position in milliseconds. The default value is 0.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: The method call was successful.
\item $<$ 0\+: The method call failed. Refer to {\ttfamily Error Codes} for details and troubleshooting suggestions. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a1343b2784c28e3376d6295892cd5ea72}\label{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a1343b2784c28e3376d6295892cd5ea72}} 
\index{io.agora.musiccontentcenter.IAgoraMusicPlayer@{io.agora.musiccontentcenter.IAgoraMusicPlayer}!open@{open}}
\index{open@{open}!io.agora.musiccontentcenter.IAgoraMusicPlayer@{io.agora.musiccontentcenter.IAgoraMusicPlayer}}
\doxysubsubsection{\texorpdfstring{open()}{open()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily int io.\+agora.\+musiccontentcenter.\+I\+Agora\+Music\+Player.\+open (\begin{DoxyParamCaption}\item[{String}]{url,  }\item[{long}]{start\+Pos }\end{DoxyParamCaption})}



Opens a music resource via U\+RL. 

Calling this method triggers the {\ttfamily on\+Player\+State\+Changed} callback. After receiving a report that the playback state is {\ttfamily P\+L\+A\+Y\+E\+R\+\_\+\+S\+T\+A\+T\+E\+\_\+\+O\+P\+E\+N\+\_\+\+C\+O\+M\+P\+L\+E\+T\+ED}, you can call the {\ttfamily play} method to play the media file.

\begin{DoxyNote}{Note}
If the music resource you want to open is protected by digital rights, you must use this method to open it. For music resources that are not protected by digital rights, you can choose to open them using this method or the {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a1343b2784c28e3376d6295892cd5ea72}{open(\+String url, long start\+Pos)}}} method under the {\ttfamily I\+Media\+Player} class.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em url} & The path to the music resource, supporting both local and online files. \\
\hline
{\em start\+Pos} & The starting position for playback in milliseconds. Default is 0.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: Method call succeeded.
\item $<$ 0\+: Method call failed. See {\ttfamily Error Codes} for details and troubleshooting suggestions. 
\end{DoxyItemize}
\end{DoxyReturn}


Implements \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a17d627406558715c2cd06ee71b587432}{io.\+agora.\+mediaplayer.\+I\+Media\+Player}}.

\mbox{\Hypertarget{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a517b16cb2a82ba4029f83a65bbbb33d0}\label{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a517b16cb2a82ba4029f83a65bbbb33d0}} 
\index{io.agora.musiccontentcenter.IAgoraMusicPlayer@{io.agora.musiccontentcenter.IAgoraMusicPlayer}!destroy@{destroy}}
\index{destroy@{destroy}!io.agora.musiccontentcenter.IAgoraMusicPlayer@{io.agora.musiccontentcenter.IAgoraMusicPlayer}}
\doxysubsubsection{\texorpdfstring{destroy()}{destroy()}}
{\footnotesize\ttfamily int io.\+agora.\+musiccontentcenter.\+I\+Agora\+Music\+Player.\+destroy (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Destroys the music player. 

\begin{DoxyRefDesc}{Deprecated}
\item[\mbox{\hyperlink{deprecated__deprecated000010}{Deprecated}}]use \mbox{\hyperlink{classio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_content_center_ab2e9dd0e7daac8921f233275cf30a9ff}{I\+Agora\+Music\+Content\+Center\#destroy\+Music\+Player(\+I\+Agora\+Music\+Player player)}} instead.\end{DoxyRefDesc}


\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: The method call succeeds.
\item $<$ 0\+: The method call fails. See {\ttfamily Error Codes} for details and troubleshooting suggestions. 
\end{DoxyItemize}
\end{DoxyReturn}


Implements \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a7b0e840af73b95213d42e155c20a5e0e}{io.\+agora.\+mediaplayer.\+I\+Media\+Player}}.

\mbox{\Hypertarget{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_af3e3f9bec20134445a680dd2e91fa241}\label{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_af3e3f9bec20134445a680dd2e91fa241}} 
\index{io.agora.musiccontentcenter.IAgoraMusicPlayer@{io.agora.musiccontentcenter.IAgoraMusicPlayer}!getPlaySrc@{getPlaySrc}}
\index{getPlaySrc@{getPlaySrc}!io.agora.musiccontentcenter.IAgoraMusicPlayer@{io.agora.musiccontentcenter.IAgoraMusicPlayer}}
\doxysubsubsection{\texorpdfstring{getPlaySrc()}{getPlaySrc()}}
{\footnotesize\ttfamily String io.\+agora.\+musiccontentcenter.\+I\+Agora\+Music\+Player.\+get\+Play\+Src (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Gets the identifier or U\+RL of the currently playing music resource. 

You need to call this method after opening the music resource\+:
\begin{DoxyItemize}
\item If you open the music resource using the {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a8d476bd955a5a25c552215066a22feb1}{open(\+Uri uri, long start\+Pos)}}} method, this method returns the identifier of the music resource ({\ttfamily song\+Code}).
\item If you open the music resource using the {\ttfamily \mbox{\hyperlink{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a1343b2784c28e3376d6295892cd5ea72}{open(\+String url, long start\+Pos)}}} method, this method returns the U\+RL of the music resource.
\end{DoxyItemize}

\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item If the method call succeeds, returns the identifier or U\+RL of the music resource.
\item If the method call fails, returns N\+U\+LL. 
\end{DoxyItemize}
\end{DoxyReturn}


Implements \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_ae38ff4b5ee5a2582e9e6e04087c14433}{io.\+agora.\+mediaplayer.\+I\+Media\+Player}}.

\mbox{\Hypertarget{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a1908d845c34b464a3531cc02ccc85b8d}\label{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a1908d845c34b464a3531cc02ccc85b8d}} 
\index{io.agora.musiccontentcenter.IAgoraMusicPlayer@{io.agora.musiccontentcenter.IAgoraMusicPlayer}!stop@{stop}}
\index{stop@{stop}!io.agora.musiccontentcenter.IAgoraMusicPlayer@{io.agora.musiccontentcenter.IAgoraMusicPlayer}}
\doxysubsubsection{\texorpdfstring{stop()}{stop()}}
{\footnotesize\ttfamily int io.\+agora.\+musiccontentcenter.\+I\+Agora\+Music\+Player.\+stop (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Stops playing the music resource. 

\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: The method call succeeds.
\item $<$ 0\+: The method call fails. See {\ttfamily Error Codes} for details and troubleshooting tips. 
\end{DoxyItemize}
\end{DoxyReturn}


Implements \mbox{\hyperlink{interfaceio_1_1agora_1_1mediaplayer_1_1_i_media_player_a96cfc3d9200e98724eb03476530e6025}{io.\+agora.\+mediaplayer.\+I\+Media\+Player}}.

\mbox{\Hypertarget{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a9a11bce8b91167e85e2d34a8a6513ab1}\label{interfaceio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_a9a11bce8b91167e85e2d34a8a6513ab1}} 
\index{io.agora.musiccontentcenter.IAgoraMusicPlayer@{io.agora.musiccontentcenter.IAgoraMusicPlayer}!setPlayMode@{setPlayMode}}
\index{setPlayMode@{setPlayMode}!io.agora.musiccontentcenter.IAgoraMusicPlayer@{io.agora.musiccontentcenter.IAgoraMusicPlayer}}
\doxysubsubsection{\texorpdfstring{setPlayMode()}{setPlayMode()}}
{\footnotesize\ttfamily int io.\+agora.\+musiccontentcenter.\+I\+Agora\+Music\+Player.\+set\+Play\+Mode (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{enumio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_1_1_music_play_mode}{Music\+Play\+Mode}}}]{mode }\end{DoxyParamCaption})}



Sets the playback mode for a music track. 

You can call this method to enable the original vocals, accompaniment, or vocal guide. If you do not call this method to set the mode, the accompaniment is played by default; if the music resource does not include accompaniment, the original vocals are played. Applicable scenarios\+: In entertainment scenarios such as online karaoke or talent shows, if you need to play licensed music provided by the Agora Content Center, you can call this method to set the playback mode. Call timing\+: You must call this method after {\ttfamily create\+Music\+Player}.

\begin{DoxyNote}{Note}
You can get detailed information about the music resource through the {\ttfamily on\+Music\+Collection\+Result} callback, and use the {\ttfamily list} parameter in the callback to check which playback modes are supported for the licensed music.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em mode} & The playback mode. See {\ttfamily \mbox{\hyperlink{enumio_1_1agora_1_1musiccontentcenter_1_1_i_agora_music_player_1_1_music_play_mode}{Music\+Play\+Mode}}} for details.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item 0\+: The method call succeeds.
\item $<$ 0\+: The method call fails. See {\ttfamily Error Codes} for details and troubleshooting.
\begin{DoxyItemize}
\item -\/2\+: Invalid parameter. Please reset the parameter. 
\end{DoxyItemize}
\end{DoxyItemize}
\end{DoxyReturn}
