From b6c0d07dc8bb4ba123e2673a83184e16a4db3d7c Mon Sep 17 00:00:00 2001 From: Blue Willow Date: Mon, 22 Apr 2024 16:41:38 -0700 Subject: [PATCH] Document AudioEffectSpectrumAnalyzerInstance, clarify relationship with AudioEffectSpectrumAnalyzer Fully document AudioEffectSpectrumAnalyzerInstance, including the weird return value of its sole method, and add a link to it in AudioEffectSpectrumAnalyzer to make it easier to figure out how to use. --- doc/classes/AudioEffectSpectrumAnalyzer.xml | 1 + doc/classes/AudioEffectSpectrumAnalyzerInstance.xml | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/classes/AudioEffectSpectrumAnalyzer.xml b/doc/classes/AudioEffectSpectrumAnalyzer.xml index fbc0c2275f2b..b90f87ef5b44 100644 --- a/doc/classes/AudioEffectSpectrumAnalyzer.xml +++ b/doc/classes/AudioEffectSpectrumAnalyzer.xml @@ -5,6 +5,7 @@ This audio effect does not affect sound output, but can be used for real-time audio visualizations. + This resource configures an [AudioEffectSpectrumAnalyzerInstance], which performs the actual analysis at runtime. An instance can be acquired with [method AudioServer.get_bus_effect_instance]. See also [AudioStreamGenerator] for procedurally generating sounds. diff --git a/doc/classes/AudioEffectSpectrumAnalyzerInstance.xml b/doc/classes/AudioEffectSpectrumAnalyzerInstance.xml index e8c6394073c7..184f80db2e66 100644 --- a/doc/classes/AudioEffectSpectrumAnalyzerInstance.xml +++ b/doc/classes/AudioEffectSpectrumAnalyzerInstance.xml @@ -1,10 +1,14 @@ + Queryable instance of an [AudioEffectSpectrumAnalyzer]. + The runtime part of an [AudioEffectSpectrumAnalyzer], which can be used to query the magnitude of a frequency range on its host bus. + An instance of this class can be acquired with [method AudioServer.get_bus_effect_instance]. + https://godotengine.org/asset-library/asset/2762 @@ -13,15 +17,17 @@ + Returns the magnitude of the frequencies from [param from_hz] to [param to_hz] in linear energy as a Vector2. The [code]x[/code] component of the return value represents the left stereo channel, and [code]y[/code] represents the right channel. + [param mode] determines how the frequency range will be processed. See [enum MagnitudeMode]. - Use the average value as magnitude. + Use the average value across the frequency range as magnitude. - Use the maximum value as magnitude. + Use the maximum value of the frequency range as magnitude.