configRhythmPlayer

Configures the virtual metronome.

public abstract int configRhythmPlayer(AgoraRhythmPlayerConfig config);

After calling startRhythmPlayer, you can use this method to reconfigure the virtual metronome. After enabling the virtual metronome, the SDK plays the specified sound effect files from the beginning and controls the playback duration of each file according to the beatsPerMinute set in AgoraRhythmPlayerConfig. For example, if beatsPerMinute is set to 60, the SDK plays one beat per second. If the file duration exceeds the beat duration, the SDK only plays the audio content within the beat duration. By default, the sound of the virtual metronome is published in the channel. If you want remote users to hear the sound, set publishRhythmPlayerTrack to true in ChannelMediaOptions.

Timing

This method can be called before or after joining a channel.

Parameters

config
Metronome configuration. See AgoraRhythmPlayerConfig.

Return Values

  • 0: Success.
  • < 0: Failure.