Class
AudioDeviceInput
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#
AccessTypeAccessModifierType | Determines whether the list of user IDs provided to
SetUserIdAccessList is
treated as an allow-list or deny-list.ReadSafe |
Activeboolean | Controls whether the physical device is actively recording.Write: RobloxScriptSecurityReadSafe |
IsReadyboolean | Denotes whether this AudioDeviceInput is ready to produce sound.Read: RobloxScriptSecurityWrite: RobloxScriptSecurityReadSafeReadOnlyNotReplicated |
Mutedboolean | Controls whether this AudioDeviceInput is muted.ReadSafe |
PlayerPlayer | Determines whose device is producing sound.ReadSafe |
Volumefloat | Volume 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#
| GetConnectedWires | Returns an array of Wires that are connected to the specified
pin. |
| GetInputPins | Gets the list of pins that Wire can use in Wire.TargetName
to connect to this instance via its Wire.TargetInstance property. |
| GetOutputPins | Gets the list of pins that Wire can use in Wire.SourceName
to connect to this instance via its Wire.SourceInstance property. |
| GetUserIdAccessList | Returns a list of user IDs that are either permitted to hear or blocked
from hearing this AudioDeviceInput. |
| SetUserIdAccessList | Sets 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.
| Name | Type | Default | Description |
|---|---|---|---|
pin | string | An input or output pin on this instance |
Returns
List<Wire>— An array ofWires
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.
| Name | Type | Default | Description |
|---|---|---|---|
userIds | Array | An array of user IDs to apply to this AudioDeviceInput. |
Returns
()— void
Events 1#
| WiringChanged | Fires 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.
| Name | Type | Default | Description |
|---|---|---|---|
connected | boolean | Whether the instance got connected or disconnected. | |
pin | string | The pin on the AudioDeviceInput that the Wire targets. | |
wire | Wire | The Wire between the AudioDeviceInput and the other
instance. | |
instance | Instance | The other instance that is or was connected through the Wire. |
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild