다음을 통해 공유


AudioTrack.SetPlaybackHeadPosition(Int32) Method

Definition

Sets the playback head position within the static buffer.

[Android.Runtime.Register("setPlaybackHeadPosition", "(I)I", "GetSetPlaybackHeadPosition_IHandler")]
public virtual Android.Media.TrackStatus SetPlaybackHeadPosition (int positionInFrames);
[<Android.Runtime.Register("setPlaybackHeadPosition", "(I)I", "GetSetPlaybackHeadPosition_IHandler")>]
abstract member SetPlaybackHeadPosition : int -> Android.Media.TrackStatus
override this.SetPlaybackHeadPosition : int -> Android.Media.TrackStatus

Parameters

positionInFrames
Int32

playback head position within buffer, expressed in frames. Zero corresponds to start of buffer. The position must not be greater than the buffer size in frames, or negative. Though this method and #getPlaybackHeadPosition() have similar names, the position values have different meanings. <br> If looping is currently enabled and the new position is greater than or equal to the loop end marker, the behavior varies by API level: as of android.os.Build.VERSION_CODES#M, the looping is first disabled and then the position is set. For earlier API levels, the behavior is unspecified.

Returns

error code or success, see #SUCCESS, #ERROR_BAD_VALUE, #ERROR_INVALID_OPERATION

Attributes

Remarks

Sets the playback head position within the static buffer. The track must be stopped or paused for the position to be changed, and must use the #MODE_STATIC mode.

Java documentation for android.media.AudioTrack.setPlaybackHeadPosition(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.

Applies to