setMusicPitch method
@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.
Implementation
FutureOr<void> setMusicPitch(NSString musicId, int pitch) async {
return await nativeCall('setMusicPitch:pitch:', [musicId, pitch]);
}