Aracılığıyla paylaş


MediaRecorder.SetAudioSamplingRate(Int32) Method

Definition

Sets the audio sampling rate for recording.

[Android.Runtime.Register("setAudioSamplingRate", "(I)V", "GetSetAudioSamplingRate_IHandler")]
public virtual void SetAudioSamplingRate (int samplingRate);
[<Android.Runtime.Register("setAudioSamplingRate", "(I)V", "GetSetAudioSamplingRate_IHandler")>]
abstract member SetAudioSamplingRate : int -> unit
override this.SetAudioSamplingRate : int -> unit

Parameters

samplingRate
Int32

the sampling rate for audio in samples per second.

Attributes

Remarks

Sets the audio sampling rate for recording. Call this method before prepare(). Prepare() may perform additional checks on the parameter to make sure whether the specified audio sampling rate is applicable. The sampling rate really depends on the format for the audio recording, as well as the capabilities of the platform. For instance, the sampling rate supported by AAC audio coding standard ranges from 8 to 96 kHz, the sampling rate supported by AMRNB is 8kHz, and the sampling rate supported by AMRWB is 16kHz. Please consult with the related audio coding standard for the supported audio sampling rate.

Java documentation for android.media.MediaRecorder.setAudioSamplingRate(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