Skip to content

Commit

Permalink
Add a description for SoundService.DefaultListenerLocation
Browse files Browse the repository at this point in the history
Adds a description for SoundService.DefaultListenerLocation
  • Loading branch information
rbxphogen authored Oct 17, 2024
1 parent 054420b commit 677b37c
Showing 1 changed file with 23 additions and 2 deletions.
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 @@ -86,8 +86,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`
So, 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`
So, 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

0 comments on commit 677b37c

Please sign in to comment.