How to get the current audio listener in a scene?

Godot Version

v4.3.stable.official

Question

I am starting to make an add-on that adds batter audio dynamics, like occlusion, to the AudioStreamPlayer3D node, and for that I need the current audio listener transform in the scene. How I get the current audio listener node in the scene?

The AudioListener3D node has a make_current() function, but I do not know how to get the current one.

I really tried to find on something the documentation, but I did not find anything about it.

Would be nice to support the cases where I use the AudioListener3D node, instead of only support cases where the camera is the listener, that can be got by the get_viewport().get_camera_3d() function.

And I would like to add features on the audio listener side too, and would be nice to have it in a script in an AudioListener3D node, not in the Camera3D node.

Viewport has an internal function get_audio_listener_3d but it is not exposed to gdscript. You could make a request for the next godot release to add it.

alternatives is to complile Godot and expose it yourself, or make your own system in gdscript to keep track of the current listener. This would mean extending the listener class to make it talk to a centralized system (an auto-load) that tracks the current listener.

I founded the internal function later too. Maybe I try to expose it. Thanks!