:github_url: hide .. meta:: :keywords: sound .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioListener2D.xml. .. _class_AudioListener2D: AudioListener2D =============== **Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` Overrides the location sounds are heard from. .. rst-class:: classref-introduction-group Description ----------- Once added to the scene tree and enabled using :ref:`make_current()`, this node will override the location sounds are heard from. Only one **AudioListener2D** can be current. Using :ref:`make_current()` will disable the previous **AudioListener2D**. If there is no active **AudioListener2D** in the current :ref:`Viewport`, center of the screen will be used as a hearing point for the audio. **AudioListener2D** needs to be inside :ref:`SceneTree` to function. .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------+--------------------------------------------------------------------------+ | |void| | :ref:`clear_current`\ (\ ) | +-------------------------+--------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_current`\ (\ ) |const| | +-------------------------+--------------------------------------------------------------------------+ | |void| | :ref:`make_current`\ (\ ) | +-------------------------+--------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_AudioListener2D_method_clear_current: .. rst-class:: classref-method |void| **clear_current**\ (\ ) :ref:`🔗` Disables the **AudioListener2D**. If it's not set as current, this method will have no effect. .. rst-class:: classref-item-separator ---- .. _class_AudioListener2D_method_is_current: .. rst-class:: classref-method :ref:`bool` **is_current**\ (\ ) |const| :ref:`🔗` Returns ``true`` if this **AudioListener2D** is currently active. .. rst-class:: classref-item-separator ---- .. _class_AudioListener2D_method_make_current: .. rst-class:: classref-method |void| **make_current**\ (\ ) :ref:`🔗` Makes the **AudioListener2D** active, setting it as the hearing point for the sounds. If there is already another active **AudioListener2D**, it will be disabled. This method will have no effect if the **AudioListener2D** is not added to :ref:`SceneTree`. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`