AudioDeviceOutput
AudioDeviceOutput accepts audio streams to be rendered out to physical hardware devices such as speakers or headphones. It provides a single Input pin that can be targeted by Wires. Any audio streams wired to an AudioDeviceOutput are heard.
Code Samples
local audioPlayer : AudioPlayer = Instance.new("AudioPlayer")
audioPlayer.Parent = workspace
audioPlayer.AssetId = "rbxassetid://9112854440"
local deviceOutput = Instance.new("AudioDeviceOutput")
deviceOutput.Parent = workspace
local wire = Instance.new("Wire")
wire.Parent = workspace
wire.SourceInstance = audioPlayer
wire.TargetInstance = deviceOutput
audioPlayer:Play()
Summary
Properties
A Player who is intended to hear the connected audio streams.
Methods
Returns an array of Wires that are connected to the specified pin.
Events
Fires when another instance is connected to or disconnected from the AudioDeviceOutput via a Wire.
Properties
Player
An optional Player who is intended to hear the connected audio streams. If left unspecified, the streams wired to this AudioDeviceOutput are heard by everyone.
Methods
GetConnectedWires
Returns an array of Wires that are connected to the specified pin. AudioDeviceOutput has one "Input" pin.
Parameters
Returns
Events
WiringChanged
Event that fires after a Wire becomes connected or disconnected, and that Wire is now or was previously connected to a pin on the AudioDeviceOutput and to some other wirable instance.
Parameters
Whether the instance got connected or disconnected.
The pin on the AudioDeviceOutput that the Wire targets.
The Wire between the AudioDeviceOutput and the other instance.