AudioDeviceInput
AudioDeviceInput produces audio streams from physical devices, such as microphones. It provides a single Output pin which can be connected to other pins via Wires. AudioDeviceInput has properties for selecting which Player is producing the stream, and controlling whether or not they are muted.
Summary
Properties
Determines whether the list of user IDs provided to SetUserIdAccessList is treated as an allow-list or deny-list.
Controls whether the physical device is actively recording.
Denotes whether this AudioDeviceInput is ready to produce sound.
Controls whether this AudioDeviceInput is muted.
Determines whose device is producing sound.
Volume level which is multiplied onto the output audio stream.
Methods
Returns an array of Wires that are connected to the specified pin.
Returns a list of user IDs that are either permitted to hear or blocked from hearing this AudioDeviceInput.
Sets a list of user IDs that are either permitted to hear or blocked from hearing this AudioDeviceInput.
Events
Fires when another instance is connected to or disconnected from the AudioDeviceInput via a Wire.
Properties
AccessType
Active
IsReady
Muted
Code Samples
local players = game:GetService("Players")
local userInput = game:GetService("UserInputService")
local audioIn: AudioDeviceInput = players.LocalPlayer:WaitForChild("AudioDeviceInput")
audioIn.Muted = true
local pushToTalkKey = Enum.KeyCode.V
userInput.InputBegan:Connect(function(input: InputObject)
if input.KeyCode == pushToTalkKey then
audioIn.Muted = false
end
end)
userInput.InputEnded:Connect(function(input: InputObject)
if input.KeyCode == pushToTalkKey then
audioIn.Muted = true
end
end)