Skip to content

Using an AudioStreamRandomizer with play_sound will error on the third attempt. #31

@dicemaster5

Description

@dicemaster5

Describe the bug
When playing a sound with SoundManager.play_sound() using an AudioStreamRandomizer as the audiostream resource the addon will error on the third use of play_sound() at sound_manager/abstract_audio_player_pool.gd on line 62 due to a missing/null player stream.

Commenting out lines 39 and 40 fixes the issue as it plays the AudioStreamRandomizer as a normal AudioStream without going into get_player_with_resource() (I'm a bit confused as to why AudioStreamRandomizer is being handled differently with this method).

The cause of the missing/null player stream is happening on line 79 in mark_player_as_available(), that's where the player gets destroyed with a queue_free().

Affected version

  • Addon version: 2.6.1
  • Godot version: 4.2.2

To Reproduce
Play a sound with SoundManager.play_sound() using an AudioStreamRandomizer as the AudioStream resource and play the sound 3 or more times, should trigger the error.

Screenshots
image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions