0.2.0-dev Download ZIP
35 lines ·1.9 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="AudioEffect" inherits="Resource" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | Base class for audio effect resources. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | The base [Resource] for every audio effect. In the editor, an audio effect can be added to the current bus layout through the Audio panel. At run-time, it is also possible to manipulate audio effects through [method AudioServer.add_bus_effect], [method AudioServer.remove_bus_effect], and [method AudioServer.get_bus_effect]. |
| 8 | When applied on a bus, an audio effect creates a corresponding [AudioEffectInstance]. The instance is directly responsible for manipulating sound, based on the original audio effect's properties. |
| 9 | </description> |
| 10 | <tutorials> |
| 11 | <link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link> |
| 12 | <link title="Audio effects">$DOCS_URL/tutorials/audio/audio_effects.html</link> |
| 13 | <link title="Audio Microphone Record Demo">https://godotengine.org/asset-library/asset/2760</link> |
| 14 | </tutorials> |
| 15 | <methods> |
| 16 | <method name="_instantiate" qualifiers="virtual required"> |
| 17 | <return type="AudioEffectInstance" /> |
| 18 | <description> |
| 19 | Override this method to customize the [AudioEffectInstance] created when this effect is applied on a bus in the editor's Audio panel, or through [method AudioServer.add_bus_effect]. |
| 20 | [codeblock] |
| 21 | extends AudioEffect |
| 22 | |
| 23 | @export var strength = 4.0 |
| 24 | |
| 25 | func _instantiate(): |
| 26 | var effect = CustomAudioEffectInstance.new() |
| 27 | effect.base = self |
| 28 | |
| 29 | return effect |
| 30 | [/codeblock] |
| 31 | [b]Note:[/b] It is recommended to keep a reference to the original [AudioEffect] in the new instance. Depending on the implementation this allows the effect instance to listen for changes at run-time and be modified accordingly. |
| 32 | </description> |
| 33 | </method> |
| 34 | </methods> |
| 35 | </class> |