startRhythmPlayer abstract method
- required String sound1,
- required String sound2,
- required AgoraRhythmPlayerConfig config,
Starts the virtual metronome.
Deprecated Deprecated since v6.6.2. After enabling the virtual metronome, the SDK starts playing the specified audio files from the beginning and controls the duration of each file based on the beatsPerMinute you set in AgoraRhythmPlayerConfig. For example, if beatsPerMinute is set to 60, the SDK plays 1 beat per second. If the file duration exceeds the beat duration, the SDK only plays the portion that fits the beat duration. By default, the sound of the virtual metronome is not published to remote users. If you want remote users to hear it, set publishRhythmPlayerTrack in ChannelMediaOptions to true after calling this method.
sound1The absolute path or URL of the strong beat file, including the file name and extension. For example, C:\music\audio.mp4. Supported audio formats: see Supported audio formats for RTC SDK.sound2The absolute path or URL of the weak beat file, including the file name and extension. For example, C:\music\audio.mp4. Supported audio formats: see Supported audio formats for RTC SDK.configMetronome configuration. See AgoraRhythmPlayerConfig.
Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.
Implementation
Future<void> startRhythmPlayer(
{required String sound1,
required String sound2,
required AgoraRhythmPlayerConfig config});