AudioListener
AudioListener records an audio stream from its surrounding AudioEmitters in the 3D world. It provides a single Output pin which can be connected to other pins via Wires. If the parent is an Attachment, Camera, or PVInstance, the parent's world CFrame will be used for listening. If the parent is not one of these classes, the AudioListener effectively hears nothing.
Code Samples
local listener = Instance.new("AudioListener")
local output = Instance.new("AudioDeviceOutput")
local wire = Instance.new("Wire")
listener.Parent = workspace.Camera
wire.Parent = listener
output.Parent = wire
wire.SourceInstance = listener
wire.TargetInstance = output
Summary
Properties
Represents how the perceived volume of the emitted sound changes based on the angle between a AudioEmitter and the LookVector associated with the AudioListener.
Controls which AudioEmitters are audible to this AudioListener.
Represents how the perceived volume of emitted sounds change as the distance between AudioEmitters and the AudioListener increases.
Controls how detailed the audio simulation should be for this AudioListener.
Methods
Gets the angle attenuation curve that the AudioListener is using, or an empty table if it's using the default curve.
Calculates how audible an AudioEmitter is for this listener
Returns an array of Wires that are connected to the specified pin.
Gets the distance attenuation curve that the AudioListener is using, or an empty table if it's using the default curve.
Lists all AudioEmitters that this listener is capable of hearing.
Sets the angle attenuation curve that the AudioListener should use, or uses a constant curve of volume 1 if none is provided.
Sets the distance attenuation curve that the AudioListener should use, or uses an inverse rolloff curve if none is provided.
Events
Fires when another instance is connected to or disconnected from the AudioListener via a Wire.