object:setSampleRate()

Type Function
Object Recording
Library media.*
Return value none
Revision 2017.3060
Keywords setSampleRate
See also object:getSampleRate()

Overview

Request an audio recording sample rate.

The recording sample rate defaults to 44100. Not all platforms may support all rates. Valid rates are 8000, 11025, 16000, 22050, 44100.

Syntax

Recording:setSampleRate( r )
r (required)

Number. Requested sampling rate. Different platforms support different rates; use object:getSampleRate() to find out the actual sampling rate.

Example

r:setSampleRate( rate )  -- Request a new sampling rate
local actualRate = r:getSampleRate()