Share via


SoundPool.SetRate(Int32, Single) Method

Definition

Change playback rate.

[Android.Runtime.Register("setRate", "(IF)V", "")]
public void SetRate (int streamID, float rate);
[<Android.Runtime.Register("setRate", "(IF)V", "")>]
member this.SetRate : int * single -> unit

Parameters

streamID
Int32

a streamID returned by the play() function

rate
Single

playback rate (1.0 = normal playback, range 0.5 to 2.0)

Attributes

Remarks

Change playback rate.

The playback rate allows the application to vary the playback rate (pitch) of the sound. A value of 1.0 means playback at the original frequency. A value of 2.0 means playback twice as fast, and a value of 0.5 means playback at half speed. If the stream does not exist, it will have no effect.

Java documentation for android.media.SoundPool.setRate(int, float).

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