Skip to main content

VideoPlayer.SetTargetAudioSource(number trackIndex, AudioSource source)

Sets the AudioSource that will receive audio samples for the specified track if this audio target is selected with VideoPlayer.audioOutputMode.

Parameters:

NameTypeDescription
trackIndexnumberIndex of the audio track to associate with the specified AudioSource.
sourceAudioSourceAudioSource to associate with the audio track.

Usage

---@type VideoPlayer
local videoplayer;

---@type number
local trackIndex;

---@type AudioSource
local source;


videoplayer.SetTargetAudioSource(trackIndex, source)