Android.Media.SoundPool.Play Method
Play a sound from a sound ID.

Syntax

[Android.Runtime.Register("play", "(IFFIIF)I", "")]
public int Play (int soundID, float leftVolume, float rightVolume, int priority, int loop, float rate)

Parameters

soundID
a soundID returned by the load() function
leftVolume
left volume value (range = 0.0 to 1.0)
rightVolume
right volume value (range = 0.0 to 1.0)
priority
stream priority (0 = lowest priority)
loop
loop mode (0 = no loop, -1 = loop forever)
rate
playback rate (1.0 = normal playback, range 0.5 to 2.0)

Returns

Documentation for this section has not yet been entered.

Remarks

Play a sound from a sound ID. Play the sound specified by the soundID. This is the value returned by the load() function. Returns a non-zero streamID if successful, zero if it fails. The streamID can be used to further control playback. Note that calling play() may cause another sound to stop playing if the maximum number of active streams is exceeded. A loop value of -1 means loop forever, a value of 0 means don't loop, other values indicate the number of repeats, e.g. a value of 1 plays the audio twice. The playback rate allows the application to vary the playback rate (pitch) of the sound. A value of 1.0 means play back at the original frequency. A value of 2.0 means play back twice as fast, and a value of 0.5 means playback at half speed.

[Android Documentation]

Requirements

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