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


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.


Recording:setSampleRate( r )
r (required)

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


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