Roblox UtilitiesDevlHub Roblox Documentation

Class

AudioDeviceInput

Inherits
Instance › Object
Memory category
Internal

Produces audio streams from physical devices, such as microphones.

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.

Properties 6#

AccessTypeAccessModifierTypeDetermines whether the list of user IDs provided to SetUserIdAccessList is treated as an allow-list or deny-list.ReadSafe
ActivebooleanControls whether the physical device is actively recording.Write: RobloxScriptSecurityReadSafe
IsReadybooleanDenotes whether this AudioDeviceInput is ready to produce sound.Read: RobloxScriptSecurityWrite: RobloxScriptSecurityReadSafeReadOnlyNotReplicated
MutedbooleanControls whether this AudioDeviceInput is muted.ReadSafe
PlayerPlayerDetermines whose device is producing sound.ReadSafe
VolumefloatVolume level which is multiplied onto the output audio stream.ReadSafe

AccessType: AccessModifierType#

ReadSafe

Determines whether the list of user IDs provided to SetUserIdAccessList is treated as an allow-list or deny-list.

If AccessType is AccessModifierType.Allow, then only the supplied user IDs are permitted to hear this AudioDeviceInput. If AccessType is AccessModifierType.Deny, then only the supplied user IDs are blocked from hearing this AudioDeviceInput.

Since player voices are networked, this property should only be assigned from the server in order to replicate properly.

Active: boolean#

Write: RobloxScriptSecurityReadSafe

Controls whether the physical device is actively recording. This property is only set by Roblox core scripts, but it may be read by user scripts. Generally, an AudioDeviceInput may only be producing sound if Active is true and Muted is false.

IsReady: boolean#

ReadOnlyNotReplicatedRead: RobloxScriptSecurityWrite: RobloxScriptSecurityReadSafe

Denotes whether this AudioDeviceInput is ready to produce sound, meaning all network connections have been established.

Muted: boolean#

ReadSafe

Controls whether this AudioDeviceInput is muted. Unlike Active, this property is publicly scriptable.

Generally, an AudioDeviceInput may only be heard if Active is true and Muted is false.

Player: Player#

ReadSafe

Determines whose device is producing sound. In order to replicate properly, this should only be assigned from the server. Assigning this property locally generally does not work, unless Player is Players.LocalPlayer.

Volume: float#

ReadSafe

Volume level which is multiplied onto the output audio stream. Ranges from 0 to 3.

Methods 5#

GetConnectedWiresReturns an array of Wires that are connected to the specified pin.
GetInputPinsGets the list of pins that Wire can use in Wire.TargetName to connect to this instance via its Wire.TargetInstance property.
GetOutputPinsGets the list of pins that Wire can use in Wire.SourceName to connect to this instance via its Wire.SourceInstance property.
GetUserIdAccessListReturns a list of user IDs that are either permitted to hear or blocked from hearing this AudioDeviceInput.
SetUserIdAccessListSets a list of user IDs that are either permitted to hear or blocked from hearing this AudioDeviceInput.

GetConnectedWires(pin: string): List<Wire>#

Returns an array of Wires that are connected to the specified pin. AudioDeviceInput has one "Output" pin.

NameTypeDefaultDescription
pinstringAn input or output pin on this instance
Returns
  • List<Wire> — An array of Wires

GetInputPins(): Array#

Gets the list of pins that Wire can use in Wire.TargetName to connect to this instance via its Wire.TargetInstance property.

For AudioDeviceInput, there are none.

Returns
  • Array — An array of strings representing valid pin names.

GetOutputPins(): Array#

Gets the list of pins that Wire can use in Wire.SourceName to connect to this instance via its Wire.SourceInstance property.

For AudioDeviceInput, this is Output only.

Returns
  • Array — An array of strings representing valid pin names.

GetUserIdAccessList(): Array#

Returns a list of user IDs that are either permitted to hear or blocked from hearing this AudioDeviceInput, depending on the AccessType.

Returns
  • Array — An array of user IDs that are either in the allow-list or the deny-list.

SetUserIdAccessList(userIds: Array): ()#

Sets a list of user IDs that are either permitted to hear or blocked from hearing this AudioDeviceInput, depending on the AccessType.

Note that this method replicates from server to client; in general, it should only be called from the server in order to replicate properly.

NameTypeDefaultDescription
userIdsArrayAn array of user IDs to apply to this AudioDeviceInput.
Returns
  • () — void

Events 1#

WiringChangedFires when another instance is connected to or disconnected from the AudioDeviceInput via a Wire.

WiringChanged(connected: boolean, pin: string, wire: Wire, instance: Instance)#

Event that fires after a Wire becomes connected or disconnected, and that Wire is now or was previously connected to a pin on the AudioDeviceInput and to some other wirable instance.

NameTypeDefaultDescription
connectedbooleanWhether the instance got connected or disconnected.
pinstringThe pin on the AudioDeviceInput that the Wire targets.
wireWireThe Wire between the AudioDeviceInput and the other instance.
instanceInstanceThe other instance that is or was connected through the Wire.

Inherited members#

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed