setLoopCount

Sets the number of times the audio effect loops.

virtual int setLoopCount(int loopCount) = 0;

Call this method to set the number of times the audio effect loops. After all loops complete, the SDK triggers the onPlayerSourceStateChanged callback and reports the playback state as PLAYER_STATE_PLAYBACK_ALL_LOOPS_COMPLETED.

Parameters

loopCount
The number of times the audio effect loops:
  • ≥ 0: The number of times to play. For example, 0 means no loop, play once only; 1 means loop once, play twice in total.
  • -1: Loop the audio file infinitely.

Return Values

  • 0: Success.
  • < 0: Failure.