From 677b37cb68f24418332ee0691b0498695379919a Mon Sep 17 00:00:00 2001 From: rbxphogen <89100144+rbxphogen@users.noreply.github.com> Date: Thu, 17 Oct 2024 09:03:05 -0700 Subject: [PATCH 1/3] Add a description for SoundService.DefaultListenerLocation Adds a description for SoundService.DefaultListenerLocation --- .../engine/classes/SoundService.yaml | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/content/en-us/reference/engine/classes/SoundService.yaml b/content/en-us/reference/engine/classes/SoundService.yaml index 9b454b8e5..7b3b75fdc 100644 --- a/content/en-us/reference/engine/classes/SoundService.yaml +++ b/content/en-us/reference/engine/classes/SoundService.yaml @@ -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: [] From 76a30327febfafd9b44ba0668684162e5daf4e35 Mon Sep 17 00:00:00 2001 From: rbxphogen <89100144+rbxphogen@users.noreply.github.com> Date: Thu, 17 Oct 2024 09:38:22 -0700 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: matthewzhang-rbx <130393460+matthewzhang-rbx@users.noreply.github.com> --- .../reference/engine/classes/SoundService.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content/en-us/reference/engine/classes/SoundService.yaml b/content/en-us/reference/engine/classes/SoundService.yaml index 7b3b75fdc..fb3c8e9be 100644 --- a/content/en-us/reference/engine/classes/SoundService.yaml +++ b/content/en-us/reference/engine/classes/SoundService.yaml @@ -92,17 +92,17 @@ properties: 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` + - 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` + - 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. From 2ee9be34c34c8a2af84b84da54a8416e39bf2eec Mon Sep 17 00:00:00 2001 From: rbxphogen <89100144+rbxphogen@users.noreply.github.com> Date: Thu, 17 Oct 2024 14:23:16 -0700 Subject: [PATCH 3/3] Apply suggestions from code review --- content/en-us/reference/engine/classes/SoundService.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en-us/reference/engine/classes/SoundService.yaml b/content/en-us/reference/engine/classes/SoundService.yaml index fb3c8e9be..ad4d4bcf7 100644 --- a/content/en-us/reference/engine/classes/SoundService.yaml +++ b/content/en-us/reference/engine/classes/SoundService.yaml @@ -96,7 +96,7 @@ properties: - 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. + 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` @@ -105,7 +105,7 @@ properties: - 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. + 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`.