Skip to content
25 changes: 23 additions & 2 deletions content/en-us/reference/engine/classes/SoundService.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,29 @@ properties:
capabilities: []
writeCapabilities: []
- name: SoundService.DefaultListenerLocation
summary: ''
description: ''
summary: |
Determines where (if anywhere) to place an `Class.AudioListener` by default.
description: |
Determines where to place an `Class.AudioListener` by default.
If `Class.SoundService.DefaultListenerLocation` is `None`, then no `Class.AudioListener` will be created by default, but `Class.AudioListeners` can be created separately by scripts.
If `Class.SoundService.DefaultListenerLocation` is `Camera`, then
- an `Class.AudioListener` will be created and parented to `Class.Workspace.CurrentCamera`
- an `Class.AudioDeviceOutput` will be created and parented to `Class.SoundService`
- a `Class.Wire` will be created and parented to the previously-created `Class.AudioListener`
- `Class.Wire.SourceInstance` will be set to the previously-created `Class.AudioListener`, and `Class.Wire.TargetInstance` will be set to the previously-created `Class.AudioDeviceOutput`
As a result, the world will be heard from the perspective (postition and orientation) of your camera.

If `Class.SoundService.DefaultListenerLocation` is `Character`, then
- an `Class.Attachment` will be created and parented to your `Class.Players.LocalPlayer`'s `Class.Player.Character`'s `Class.Model.PrimaryPart`
- an `Class.AudioListener` will be created and parented to the `Class.Attachment`
- an `Class.AudioDeviceOutput` will be created and parented to `Class.SoundService`
- a `Class.Wire` will be created and parented to the previously-created `Class.AudioListener`
- `Class.Wire.SourceInstance` will be set to the previously-created `Class.AudioListener`, and `Class.Wire.TargetInstance` will be set to the previously-created `Class.AudioDeviceOutput`
- the previously-created `Class.Attachment` will be updated once-per-frame to face the same direction as `Class.Workspace.CurrentCamera`
As a result, the world will be heard from the position of your character, while matching the orientation of your camera.

If `Class.SoundService.DefaultListenerLocation` is `Default`, then its behavior depends on the value of `Class.VoiceChatService.EnableDefaultVoice` and `Class.VoiceChatService.UseAudioApi`.
When using the default voice setup with the audio API, this behaves similarly to `Camera`.
code_samples: []
type: ListenerLocation
tags: []
Expand Down