rojo/.cursor/rules/roblox/reference/engine/classes/AudioEmitter.yaml
2026-02-02 12:08:47 -06:00

436 lines
14 KiB
YAML

# This file is automatically generated. Please don't edit it manually.
# To submit a bug report on the content, see
# https://devforum.roblox.com/c/bug-reports/documentation-issues/72
name: AudioEmitter
type: class
memory_category: Internal
summary: |
Emits audio streams into the world.
description: |
`Class.AudioEmitter` emits audio streams into the world. It provides a single
**Input** pin that can be connected to by one or more `Class.Wire|Wires`. Any
streams wired to an `Class.AudioEmitter` get broadcasted into the world from
the emitter's parent's position. If the parent is an `Class.Attachment`,
`Class.Camera`, or `Class.PVInstance`, the parent's world-position will be
used. If the parent is not one of these classes, the `Class.AudioEmitter` is
effectively silent.
`Class.AudioEmitter|AudioEmitters` are heard by
`Class.AudioListener|AudioListeners` in order to implement 3D spatialization.
code_samples:
- audio-wiring---multi-emission
inherits:
- Instance
descendants: []
tags: []
deprecation_message: ''
properties:
- name: AudioEmitter.AcousticSimulationEnabled
summary: ''
description: ''
code_samples: []
type: boolean
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Simulation
serialization:
can_load: true
can_save: true
capabilities:
- Audio
- name: AudioEmitter.AngleAttenuation
summary: |
Represents how the perceived volume of the emitted sound changes based on
the angle between a `Class.AudioListener` and the
`Datatype.CFrame.LookVector|LookVector` associated with the
`Class.AudioEmitter`.
description: |
Represents a volume-over-angle curve that affects how loudly a
`Class.AudioListener` will hear the `Class.AudioEmitter`, based on the
angle between them and the `Datatype.CFrame.LookVector|LookVector`
associated with the `Class.AudioEmitter`.
This property is internal and can't be accessed by scripts; it exists to
support replication. See
`Class.AudioEmitter:SetAngleAttenuation()|SetAngleAttenuation()` for usage
details.
code_samples: []
type: BinaryString
tags: []
deprecation_message: ''
security:
read: RobloxEngineSecurity
write: RobloxEngineSecurity
thread_safety: ReadSafe
category: Emission
serialization:
can_load: true
can_save: true
capabilities:
- Audio
- name: AudioEmitter.AudioInteractionGroup
summary: |
Controls which `Class.AudioListener|AudioListeners` are capable of hearing
this `Class.AudioEmitter`.
description: |
If an `Class.AudioEmitter` and an `Class.AudioListener` share an
interaction group, then the listener is capable of hearing the emitter.
code_samples: []
type: string
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Interactions
serialization:
can_load: true
can_save: true
capabilities:
- Audio
- name: AudioEmitter.DistanceAttenuation
summary: |
Represents how the perceived volume of the emitted sound changes as the
distance between a `Class.AudioListener` and the `Class.AudioEmitter`
increases.
description: |
Represents a volume-over-distance curve that affects how loudly a
`Class.AudioListener` will hear the `Class.AudioEmitter`, based on the
distance between them.
This property is internal and can't be accessed by scripts; it exists to
support replication. See
`Class.AudioEmitter:SetDistanceAttenuation()|SetDistanceAttenuation()` for
usage details.
code_samples: []
type: BinaryString
tags: []
deprecation_message: ''
security:
read: RobloxEngineSecurity
write: RobloxEngineSecurity
thread_safety: ReadSafe
category: Emission
serialization:
can_load: true
can_save: true
capabilities:
- Audio
- name: AudioEmitter.PositionOverride
summary: ''
description: ''
code_samples: []
type: Instance
tags: []
deprecation_message: ''
security:
read: RobloxEngineSecurity
write: RobloxEngineSecurity
thread_safety: ReadSafe
category: Data
serialization:
can_load: true
can_save: true
capabilities:
- Audio
- name: AudioEmitter.SimulationFidelity
summary: |
Controls how detailed the audio simulation should be for this
`Class.AudioEmitter`.
description: |
Controls how detailed the audio simulation should be for this
`Class.AudioEmitter`, similar to `Class.MeshPart.CollisionFidelity` or
`Class.MeshPart.RenderFidelity`.
`Class.AudioEmitter|AudioEmitters` and
`Class.AudioListener|AudioListeners` which disagree on the necessary level
of detail will use the less-detailed option.
code_samples: []
type: AudioSimulationFidelity
tags:
- Deprecated
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Simulation
serialization:
can_load: true
can_save: true
capabilities:
- Audio
methods:
- name: AudioEmitter:GetAngleAttenuation
summary: |
Gets the angle attenuation curve that the `Class.AudioEmitter` is using,
or an empty table if it's using the default curve.
description: |
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.
code_samples: []
parameters: []
returns:
- type: Dictionary
summary: |
Table mapping angle to volume, as described above.
tags:
- CustomLuaState
deprecation_message: ''
security: None
thread_safety: Unsafe
capabilities:
- Audio
- name: AudioEmitter:GetAudibilityFor
summary: |
Calculates how audible this emitter is for a particular
`Class.AudioListener`.
description: |
Calculates how audible this emitter is for a particular
`Class.AudioListener`. The resulting volume, ranging from `0` to `1`,
accounts for distance and angle attenuation on both the emitter and
listener.
code_samples: []
parameters:
- name: listener
type: AudioListener
default:
summary: ''
returns:
- type: float
summary: ''
tags: []
deprecation_message: ''
security: None
thread_safety: Unsafe
capabilities:
- Audio
- name: AudioEmitter:GetConnectedWires
summary: |
Returns an array of `Class.Wire|Wires` that are connected to the specified
pin.
description: |
Returns an array of `Class.Wire|Wires` that are connected to the specified
pin. `Class.AudioEmitter` has one "Input" pin.
code_samples: []
parameters:
- name: pin
type: string
default:
summary: ''
returns:
- type: Instances
summary: ''
tags: []
deprecation_message: ''
security: None
thread_safety: Unsafe
capabilities:
- Audio
- name: AudioEmitter:GetDistanceAttenuation
summary: |
Gets the distance attenuation curve that the `Class.AudioEmitter` is
using, or an empty table if it's using the default curve.
description: |
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.
code_samples: []
parameters: []
returns:
- type: Dictionary
summary: ''
tags:
- CustomLuaState
deprecation_message: ''
security: None
thread_safety: Unsafe
capabilities:
- Audio
- name: AudioEmitter:GetInputPins
summary: ''
description: ''
code_samples: []
parameters: []
returns:
- type: Array
summary: ''
tags: []
deprecation_message: ''
security: None
thread_safety: Unsafe
capabilities:
- Audio
- name: AudioEmitter:GetInteractingListeners
summary: |
Lists all `Class.AudioListener|AudioListeners` that are capable of hearing
this emitter.
description: |
Returns an array of `Class.AudioListener|AudioListeners` that share an
`Class.AudioEmitter.AudioInteractionGroup|AudioInteractionGroup` with the
emitter.
code_samples: []
parameters: []
returns:
- type: Instances
summary: ''
tags: []
deprecation_message: ''
security: None
thread_safety: Unsafe
capabilities:
- Audio
- name: AudioEmitter:GetOutputPins
summary: ''
description: ''
code_samples: []
parameters: []
returns:
- type: Array
summary: ''
tags: []
deprecation_message: ''
security: None
thread_safety: Unsafe
capabilities:
- Audio
- name: AudioEmitter:SetAngleAttenuation
summary: |
Sets the angle attenuation curve that the `Class.AudioEmitter` should use,
or uses a constant curve of volume `1` if none is provided.
description: |
Sets a volume-over-angle curve that affects how loudly a
`Class.AudioListener` will hear the `Class.AudioEmitter`, based on the
angle between them and the `Datatype.CFrame.LookVector|LookVector`
associated with the `Class.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 `Class.AudioEmitter` from the perspective of a
`Class.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 `Class.AudioListener`) to
obtain the final audibility.
If the table is empty or `nil`, the `Class.AudioEmitter` defaults to using
an angle attenuation curve with the constant volume value of `1`.
code_samples: []
parameters:
- name: curve
type: Dictionary
default:
summary: ''
returns:
- type: ()
summary: ''
tags:
- CustomLuaState
deprecation_message: ''
security: None
thread_safety: Unsafe
capabilities:
- Audio
- name: AudioEmitter:SetDistanceAttenuation
summary: |
Sets the distance attenuation curve that the `Class.AudioEmitter` should
use, or uses an inverse rolloff curve if none is provided.
description: |
Sets a volume-over-distance curve that affects how loudly a
`Class.AudioListener` will hear the `Class.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 `Class.AudioEmitter` from the perspective of a
`Class.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 `Class.AudioListener`) to
obtain the final audibility.
If the table is empty or `nil`, the `Class.AudioEmitter` defaults to using
a distance attenuation curve determined by the inverse-square law.
code_samples:
- audio-wiring---custom-distance-attenuation
parameters:
- name: curve
type: Dictionary
default:
summary: ''
returns:
- type: ()
summary: ''
tags:
- CustomLuaState
deprecation_message: ''
security: None
thread_safety: Unsafe
capabilities:
- Audio
events:
- name: AudioEmitter.WiringChanged
summary: |
Fires when another instance is connected to or disconnected from the
`Class.AudioEmitter` via a `Class.Wire`.
description: |
Event that fires after a `Class.Wire` becomes connected or disconnected,
and that `Class.Wire` is now or was previously connected to a pin on the
`Class.AudioEmitter` and to some other wirable instance.
code_samples: []
parameters:
- name: connected
type: boolean
default:
summary: |
Whether the instance got connected or disconnected.
- name: pin
type: string
default:
summary: |
The pin on the `Class.AudioEmitter` that the `Class.Wire` targets.
- name: wire
type: Wire
default:
summary: |
The `Class.Wire` between the `Class.AudioEmitter` and the other
instance.
- name: instance
type: Instance
default:
summary: |
The other instance that is or was connected through the `Class.Wire`.
tags: []
deprecation_message: ''
security: None
capabilities:
- Audio
callbacks: []