Android.Media.AudioTrack.Write Method
Writes the audio data to the audio sink for playback (streaming mode), or copies audio data for later playback (static buffer mode).

Syntax

[Android.Runtime.Register("write", "(Ljava/nio/ByteBuffer;II)I", "GetWrite_Ljava_nio_ByteBuffer_IIHandler")]
public virtual int Write (Java.Nio.ByteBuffer audioData, int sizeInBytes, [Android.Runtime.GeneratedEnum] WriteMode writeMode)

Parameters

audioData
the buffer that holds the data to play, starting at the position reported by audioData.position().

Note that upon return, the buffer position (audioData.position()) will have been advanced to reflect the amount of data that was successfully written to the AudioTrack.
sizeInBytes
number of bytes to write.

Note this may differ from audioData.remaining(), but cannot exceed it.
writeMode
one of AudioTrack.WRITE_BLOCKING, AudioTrack.WRITE_NON_BLOCKING. It has no effect in static mode.

With AudioTrack.WRITE_BLOCKING, the write will block until all data has been written to the audio sink.

With AudioTrack.WRITE_NON_BLOCKING, the write will return immediately after queuing as much audio data for playback as possible without blocking.

Returns

Documentation for this section has not yet been entered.

Remarks

Writes the audio data to the audio sink for playback (streaming mode), or copies audio data for later playback (static buffer mode). In static buffer mode, copies the data to the buffer starting at its 0 offset, and the write mode is ignored. In streaming mode, the blocking behavior will depend on the write mode.

[Android Documentation]

Requirements

Namespace: Android.Media
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 3