Skip to content

Api > VideoPlayer > GetAudioSampleRate()


VideoPlayer.GetAudioSampleRate(number trackIndex)⚓︎

Gets the audio track sampling rate in Hertz.

Parameters:⚓︎

Name Type Description
trackIndex number Index of the audio track to query.

Returns:⚓︎

type Description
number The sampling rate in Hertz.

Usage⚓︎

---@type VideoPlayer
local videoplayer;

---@type number
local trackIndex;


local val0 = videoplayer.GetAudioSampleRate(trackIndex)

Extra Detail⚓︎

For URL sources, this will only be set once the source preparation is completed. See VideoPlayer.Prepare.