Agora RTC Objective-C API Reference  Refactor
Instance Methods
<AgoraMusicPlayerProtocol> Protocol Reference

Inherits <NSObjectAgoraRtcMediaPlayerProtocol>.

Instance Methods

(NSInteger) - openMediaWithSongCode:startPos:
 
(NSInteger) - setPlayMode:
 

Method Documentation

◆ openMediaWithSongCode:startPos:

- (NSInteger) openMediaWithSongCode: (NSInteger)  songCode
startPos: (NSInteger)  startPos 

Open a media file with specified parameters.

Parameters
songCodeThe identifier of the media file that you want to play.
startPosThe playback position (ms) of the music file.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setPlayMode:

- (NSInteger) setPlayMode: (AgoraMusicPlayMode mode

Set the mode for playing songs. You can call this method to switch from original to accompaniment or lead vocals. If you do not call this method to set the mode, the SDK plays the accompaniment by default.

Parameters
modelThe playing mode.
Returns
  • 0: Success.
  • < 0: Failure.