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", "([FIII)I", "GetWrite_arrayFIIIHandler")]
public virtual int Write (float[] audioData, int offsetInFloats, int sizeInFloats, [Android.Runtime.GeneratedEnum] WriteMode writeMode)

Parameters

audioData
the array that holds the data to play. The implementation does not clip for sample values within the nominal range [-1.0f, 1.0f], provided that all gains in the audio pipeline are less than or equal to unity (1.0f), and in the absence of post-processing effects that could add energy, such as reverb. For the convenience of applications that compute samples using filters with non-unity gain, sample values +3 dB beyond the nominal range are permitted. However such values may eventually be limited or clipped, depending on various gains and later processing in the audio path. Therefore applications are encouraged to provide samples values within the nominal range.
offsetInFloats
the offset, expressed as a number of floats, in audioData where the data to play starts.
sizeInFloats
the number of floats to read in audioData after the offset.
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 offset 0, and the write mode is ignored. In streaming mode, the blocking behavior will depend on the write mode.

Note that the actual playback of this data might occur after this function returns. This function is thread safe with respect to AudioTrack.Stop calls, in which case all of the specified data might not be written to the audio sink.

[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