@detail api
@author lihuan.wuti2ha
@brief Pauses the music.
@param musicId Music ID.
@note
- After calling this API, you will receive the music play state through ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback.
- If the music ID is invalid, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3023 and a playState of 4.
- If you didn't join the room, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3022 and a playState of 4.
@detail api
@author lihuan.wuti2ha
@brief Plays the music.
@param musicId Music ID.
If the song with the same musicId is playing when you call this API, the music will restart from the starting position. An error will be triggered if the audio file corresponding to musicId does not exist.
@param trackType Audio track type of the KTV player. See ByteRTCAudioTrackType{@link #ByteRTCAudioTrackType}.
@param playType Audio play type. See ByteRTCAudioPlayType{@link #ByteRTCAudioPlayType}.
@note
- After calling this API, you will receive the music play state through ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback.
- If the music ID is invalid, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3023 and a playState of 4.
- If you didn't join the room, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3022 and a playState of 4.
- If the music file does not exist, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3020 and a playState of 4.
@detail api
@author lihuan.wuti2ha
@brief Resumes playing the music.
@param musicId Music ID.
@note
- After calling this API, you will receive the music play state through ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback.
- If the music ID is invalid, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3023 and a playState of 4.
- If you didn't join the room, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3022 and a playState of 4.
@detail api
@author lihuan.wuti2ha
@brief Sets the starting position of the music file.
@param musicId Music ID.
@param position The starting position of the music file in milliseconds. The value must be less than the total length of the music.
@note
- The music must be playing when you call this API.
- After calling this API, you will receive the music play state through ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback.
- If the music ID is invalid, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3023 and a playState of 4.
- If you didn't join the room, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3022 and a playState of 4.
@detail api
@author lihuan.wuti2ha
@brief Transposes up/down the music being played.
@param musicId Music ID.
@param pitch The pitch up/down value relative to the original pitch, in the range of -12, 12, with the default value of 0.
The difference in pitch between two adjacent values is a semitone. A positive value indicates an increase in pitch, and a negative value indicates a decrease in pitch. A larger absolute value means more pitch increase or decrease.
@note
- The music must be in the playing when you call this API.
- If the set pitch is greater than 12, it will be adjusted by the maximum value of 12; if the set pitch is less than –12, it will be adjusted by the minimum value of –12.
- If the music ID is invalid, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3023 and a playState of 4.
- If you didn't join the room, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3022 and a playState of 4.
@detail api
@author lihuan.wuti2ha
@brief Sets the volume of the playing music. The music must be playing when you set the volume.
@param musicId Music ID.
@param volume Volume. Adjustment range: 0,400.
- 0: Mute.
- 100: Original volume.
- 400: 4 times the original volume (with overflow protection).
@note
- The music must be playing when you call this API.
- If the set volume is greater than 400, it will be adjusted by the maximum value of 400; if the set volume is less than 0, it will be adjusted by the minimum value of 0.
- If the music ID is invalid, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3023 and a playState of 4.
- If you didn't join the room, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3022 and a playState of 4.
@detail api
@author lihuan.wuti2ha
@brief Stops playing the music.
@param musicId Music ID.
@note
- After calling this API, you will receive the music play state through ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback.
- If the music ID is invalid, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3023 and a playState of 4.
- If you didn't join the room, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3022 and a playState of 4.
@detail api
@author lihuan.wuti2ha
@brief Switches the audio track type between the original track and the instrumental track.
@param musicId Music ID.
@note The music must be playing when you call this API.