Closed 3ter closed 4 months ago
Hello ! This means you don't have any listener set, or you don't have any valid node attached to listeners. Can you provide your scene structure ?
So I thought I'd only need a listener on the player
(as it can move in the 2D space) but then the warning is triggered in the main menu (below UI in the screenshot) the first time.
When the room is switched then (so starting room
below is replaced by another one) the warning is triggered again.
EDIT: I just saw that there's a built-in AudioListener2D
node. This has a current
property to enable/disable it. Isn't this needed for the FmodListener2D
as well? Or can you listen from multiple positions at once (sounds confusing... pun not intended).
I saw https://fmod-gdextension.readthedocs.io/en/latest/user-guide/3-nodes/#fmod-listeners, but it didn't really help there.
So I thought I'd only need a listener on the
player
(as it can move in the 2D space) but then the warning is triggered in the main menu (below UI in the screenshot) the first time. When the room is switched then (sostarting room
below is replaced by another one) the warning is triggered again.EDIT: I just saw that there's a built-in
AudioListener2D
node. This has acurrent
property to enable/disable it. Isn't this needed for theFmodListener2D
as well? Or can you listen from multiple positions at once (sounds confusing... pun not intended).I saw https://fmod-gdextension.readthedocs.io/en/latest/user-guide/3-nodes/#fmod-listeners, but it didn't really help there.
AudioListener2D
has nothing to do with fmod, it comes from godot builtin sound engine.
When you switch scene you don't have a listener set for few moment, so it will print the warn.
It should stop printing it when you add back a listener.
I do know that they are unrelated. I just had two FmodListener2D
and wanted to know how they work together. It seems they don't.
FmodListener2D
the one attached to the player seems to take precedence (independend from the index
setting on both nodes) and the warning is thrown on scene switch.FmodListener2D
attached to the main
scene then no warnings are printed (but I suppose I loose the ability for spatial audio according to the player's position).So I suppose I can only have one FmodListener2D
in the scene tree at a given time and should reparent it from the main
scene to the player
when it's instantiated. Is that all correct?
Thanks a lot for your help so far, I do appreciate it!
I do know that they are unrelated. I just had two
FmodListener2D
and wanted to know how they work together. It seems they don't.
- When I have 2
FmodListener2D
the one attached to the player seems to take precedence (independend from theindex
setting on both nodes) and the warning is thrown on scene switch.- When I only have 1
FmodListener2D
attached to themain
scene then no warnings are printed (but I suppose I loose the ability for spatial audio according to the player's position).So I suppose I can only have one
FmodListener2D
in the scene tree at a given time and should reparent it from themain
scene to theplayer
when it's instantiated. Is that all correct?Thanks a lot for your help so far, I do appreciate it!
You don't lose spatialisation with only one listener.
If you want to setup more listeners you have to set listeners indexes in node, but you also have to change listener count in project settings:
So for a scene change you recommend to reparent the same listener or attach a new one to a scene higher up in the hierarchy so there's always one listener available?
So for a scene change you recommend to reparent the same listener or attach a new one to a scene higher up in the hierarchy so there's always one listener available?
I think the warning is not important. Fmod will provide you a default listener without position until you re-add one.
Even using reparent()
the FMOD sound system emits this warning. I can't think of a way to get around it.
Thank you for your ongoing support. If you've got a project to share where it's done, I'd be happy to check it out 🙂 .
Just wanted to add that I managed to get rid of the error by making sure the listener added to the main scene is only then freed, when there already is another one ready. The trick was to use the tree_entered
signal accordingly.
func start_game() -> void:
$BackgroundMusic.play()
room_path_to_load = STARTING_ROOM
spawn_point_to_load = STARTING_SPAWN_POINT
on_current_room_freed()
current_room.tree_entered.connect(on_starting_room_loaded)
func on_starting_room_loaded() -> void:
$FmodListener2D.queue_free()
room_changed.emit()
I've added an
FmodListener2D
both to mymaster
scene and to theplayer
scene but still the error pops up when I change rooms (which doesn't free themaster
scene).Original warning:
Please help me understand the concept better.