Proper use of AudioStreamPlayer

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Siorys

Hello, I’m really curious as how to properly use the AudioStreamPlayer node. As I see it now there are 3 possible ways to go:

  • Each entity has their own single audio player and changes streams depending on the desired sound.
  • Each entity has a separate audio player for each sound effect
  • The audio player is generalized inside a global singleton or inside the current game state script and is called by each interested node. Upon call, the player switches its stream to the desired sound file and plays.

What are the differences between these approaches in terms of efficiency and organization? Also, should local players bee queue_free’d when no longer used? Thanks a lot in advance!