AudioEmitter
Emits audio streams into the world.
Memory category | Internal |
---|
Member index 12
Description
AudioEmitter emits audio streams into the world. It provides a single Input pin that can be connected to by one or more Wires. Any streams wired to an AudioEmitter get broadcasted into the world from the emitter's parent's position. If the parent is an Attachment, Camera, or PVInstance, the parent's world-position will be used. If the parent is not one of these classes, the AudioEmitter is effectively silent.
AudioEmitters are heard by AudioListeners in order to implement 3D spatialization.
History 24
- 652 Add WiringChanged
- 652 Add SimulationFidelity
- 648 Add SetAngleAttenuation
- 648 Change ReturnType of GetInteractingListeners from Objects to Instances
- 648 Change ReturnType of GetConnectedWires from Objects to Instances
- 648 Add GetAngleAttenuation
- 648 Add AngleAttenuation
- 643 Change Tags of AudioEmitter from [NotBrowsable] to []
- 637 Change ReturnType of GetInteractingListeners from Array to Objects
- 637 Change ReturnType of GetConnectedWires from Array to Objects
- 636 Change Security of GetInteractingListeners from RobloxScriptSecurity to None
- 625 Change Category of DistanceAttenuation from Data to Emission
- 620 Add SetDistanceAttenuation
- 620 Add GetDistanceAttenuation
- 620 Add DistanceAttenuation
- 618 Change Security of GetConnectedWires from PluginSecurity to None
- 607 Change Security of GetConnectedWires from RobloxScriptSecurity to PluginSecurity
- 597 Change MemoryCategory of AudioEmitter from Instances to Internal
- 593 Add GetInteractingListeners
- 593 Add GetConnectedWires
- 593 Add GetAudibilityFor
- 592 Change Category of AudioInteractionGroup from Data to Interactions
- 588 Add AudioInteractionGroup
- 588 Add AudioEmitter
Members 12
AngleAttenuation
Type | Default | |
---|---|---|
BinaryString |
Represents a volume-over-angle curve that affects how loudly a AudioListener will hear the AudioEmitter, based on the angle between them and the LookVector associated with the AudioEmitter.
This property is internal and can't be accessed by scripts; it exists to support replication. See SetAngleAttenuation() for usage details.
Security | RobloxSecurity |
---|---|
Thread safety | ReadSafe |
Category | Emission |
Loaded/Saved | true |
History 1
- 648 Add AngleAttenuation
AudioInteractionGroup
Type | Default | |
---|---|---|
string |
If an AudioEmitter and an AudioListener share an interaction group, then the listener is capable of hearing the emitter.
Thread safety | ReadSafe |
---|---|
Category | Interactions |
Loaded/Saved | true |
History 2
- 592 Change Category of AudioInteractionGroup from Data to Interactions
- 588 Add AudioInteractionGroup
DistanceAttenuation
Type | Default | |
---|---|---|
BinaryString |
Represents a volume-over-distance curve that affects how loudly a AudioListener will hear the AudioEmitter, based on the distance between them.
This property is internal and can't be accessed by scripts; it exists to support replication. See SetDistanceAttenuation() for usage details.
Security | RobloxSecurity |
---|---|
Thread safety | ReadSafe |
Category | Emission |
Loaded/Saved | true |
History 2
- 625 Change Category of DistanceAttenuation from Data to Emission
- 620 Add DistanceAttenuation
GetAngleAttenuation
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Dictionary |
Returns a table mapping angle to volume. Keys are numbers between 0
and
180
(inclusive), while values are numbers between 0
and 1
(inclusive) describing how volume attenuates depending on direction. This
method returns an empty table if the default angle attenuation curve is
being used.
Thread safety | Unsafe |
---|
History 1
GetAudibilityFor
Parameters (1) | ||
---|---|---|
listener | AudioListener | |
Returns (1) | ||
float |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 593 Add GetAudibilityFor
GetConnectedWires
Parameters (1) | ||
---|---|---|
pin | string | |
Returns (1) | ||
Instances |
Returns an array of Wires that are connected to the specified pin. AudioEmitter has one "Input" pin.
Thread safety | Unsafe |
---|
History 5
- 648 Change ReturnType of GetConnectedWires from Objects to Instances
- 637 Change ReturnType of GetConnectedWires from Array to Objects
- 618 Change Security of GetConnectedWires from PluginSecurity to None
- 607 Change Security of GetConnectedWires from RobloxScriptSecurity to PluginSecurity
- 593 Add GetConnectedWires
GetDistanceAttenuation
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Dictionary |
Returns a table mapping distance to volume. Keys are numbers greater than or equal to 0, while values are numbers between 0 and 1 (inclusive) describing how volume attenuates over distance. This method returns an empty table if the default distance attenuation curve is being used.
Thread safety | Unsafe |
---|
History 1
GetInteractingListeners
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Instances |
Thread safety | Unsafe |
---|
History 4
- 648 Change ReturnType of GetInteractingListeners from Objects to Instances
- 637 Change ReturnType of GetInteractingListeners from Array to Objects
- 636 Change Security of GetInteractingListeners from RobloxScriptSecurity to None
- 593 Add GetInteractingListeners
SetAngleAttenuation
Parameters (1) | ||
---|---|---|
curve | Dictionary | |
Returns (1) | ||
null |
Sets a volume-over-angle curve that affects how loudly a AudioListener will hear the AudioEmitter, based on the angle between them and the LookVector associated with the AudioEmitter.
The curve is represented by a table mapping angle keys to volume values.
Keys are expected to be unique numbers between 0
and 180
(inclusive),
while values are expected to be numbers between 0
and 1
(inclusive).
Tables containing up to 400 key-value pairs are supported.
The volume of the AudioEmitter from the perspective of a
AudioListener at an angle a
is determined by linearly
interpolating between the volume levels for the points on the curve whose
angle values are directly above and below a
. If there is either no point
below a
or no point above a
, the volume level of the other point is
chosen. Essentially, the curve is a sequence of points connected by
straight lines, and beyond its left and right endpoints the curve extends
outward at their respective volume levels.
This volume will be multiplied with the volumes from all other attenuation curves (including the ones on the receiving AudioListener) to obtain the final audibility.
If the table is empty or nil
, the AudioEmitter defaults to using
an angle attenuation curve with the constant volume value of 1
.
Thread safety | Unsafe |
---|
History 1
SetDistanceAttenuation
Parameters (1) | ||
---|---|---|
curve | Dictionary | |
Returns (1) | ||
null |
Sets a volume-over-distance curve that affects how loudly a AudioListener will hear the AudioEmitter, based on the distance between them.
The curve is represented by a table mapping distance keys to volume values. Keys are expected to be unique numbers greater than or equal to 0, while values are expected to be numbers between 0 and 1 (inclusive). Tables containing up to 400 key-value pairs are supported.
The volume of the AudioEmitter from the perspective of a
AudioListener at a distance d
is determined by linearly
interpolating between the volume levels for the points on the curve whose
distance values are directly above and below d
. If there is either no
point below d
or no point above d
, the volume level of the other point
is chosen. Essentially, the curve is a sequence of points connected by
straight lines, and beyond its left and right endpoints the curve extends
outward infinitely at their respective volume levels.
This volume will be multiplied with the volumes from all other attenuation curves (including the ones on the receiving AudioListener) to obtain the final audibility.
If the table is empty or nil
, the AudioEmitter defaults to using
a distance attenuation curve determined by the inverse-square law.
Thread safety | Unsafe |
---|
History 1
SimulationFidelity
Type | Default | |
---|---|---|
AudioSimulationFidelity | Automatic |
Thread safety | ReadSafe |
---|---|
Category | Simulation |
Loaded/Saved | true |
History 1
WiringChanged
Parameters (4) | |
---|---|
connected | bool |
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 AudioEmitter and to some other wirable instance.
Thread safety | Unsafe |
---|
History 1
- 652 Add WiringChanged