Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a description for SoundService.DefaultListenerLocation #868

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation supports nested lists, right? We could indent this one forward to put it under the previous line about the wire

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that need special syntax? I'm not familiar

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm I would think you indent the bullet one more time but I don't know how legit that is

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`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could move this line to be indented under the earlier line about the Attachment

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
Loading