AudioTrack.SetLoopPoints(Int32, Int32, Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the loop points and the loop count.
[Android.Runtime.Register("setLoopPoints", "(III)I", "GetSetLoopPoints_IIIHandler")]
public virtual Android.Media.TrackStatus SetLoopPoints (int startInFrames, int endInFrames, int loopCount);
[<Android.Runtime.Register("setLoopPoints", "(III)I", "GetSetLoopPoints_IIIHandler")>]
abstract member SetLoopPoints : int * int * int -> Android.Media.TrackStatus
override this.SetLoopPoints : int * int * int -> Android.Media.TrackStatus
Parameters
- startInFrames
- Int32
loop start marker expressed in frames. Zero corresponds to start of buffer. The start marker must not be greater than or equal to the buffer size in frames, or negative.
- endInFrames
- Int32
loop end marker expressed in frames.
The total buffer size in frames corresponds to end of buffer.
The end marker must not be greater than the buffer size in frames.
For looping, the end marker must not be less than or equal to the start marker,
but to disable looping
it is permitted for start marker, end marker, and loop count to all be 0.
If any input parameters are out of range, this method returns #ERROR_BAD_VALUE
.
If the loop period (endInFrames - startInFrames) is too small for the implementation to
support,
#ERROR_BAD_VALUE
is returned.
The loop range is the interval [startInFrames, endInFrames).
<br>
As of android.os.Build.VERSION_CODES#M
, the position is left unchanged,
unless it is greater than or equal to the loop end marker, in which case
it is forced to the loop start marker.
For earlier API levels, the effect on position is unspecified.
- loopCount
- Int32
the number of times the loop is looped; must be greater than or equal to -1. A value of -1 means infinite looping, and 0 disables looping. A value of positive N means to "loop" (go back) N times. For example, a value of one means to play the region two times in total.
Returns
error code or success, see #SUCCESS
, #ERROR_BAD_VALUE
,
#ERROR_INVALID_OPERATION
- Attributes
Remarks
Sets the loop points and the loop count. The loop can be infinite. Similarly to setPlaybackHeadPosition, the track must be stopped or paused for the loop points to be changed, and must use the #MODE_STATIC
mode.
Java documentation for android.media.AudioTrack.setLoopPoints(int, int, int)
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.