Request for `StaticSound.play()` to return `_StaticSoundInstance`

@docEdub Thank you for all of your help with sounds :smiley:

When you have time, do you think that it would be a good idea for StaticSound.play()(Source) to return the created _StaticSoundInstance?

I was also curious if.dispose()is ever called on this created _StaticSoundInstanceafter it’s done playing?

I’m trying to debug why my app frequently goes silent after playing ~50 cloned spatial sounds simultaneously. I’m trying to implement logic to stop older cloned sounds to allow newer cloned sounds to play, but my app is still going silent for several seconds at a time.

Thus, I was wondering if _StaticSoundInstance is ever disposed and hoping for _StaticSoundInstanceto be returned in case I need to manually dispose()them.

Thank you so much, docEdub!

I’ll look into the dropout issue you’re getting. As always, though, a repro playground would help a lot :slight_smile:

Regarding instances, I went back and forth on whether to expose them or not and decided against it because I don’t think they’re the right API for the more advanced features we’ve got in mind. The currently limited instances API is only meant for playing the same sound more than once without cutting off the sound if it’s already playing. To become more than that, the instances implementation will need to be a lot more robust and flexible, which I’m not 100% sure makes sense for our future plans.

1 Like

Understood, thank you so much for all your help here, docEdub :smiley: Let me try to create a playground to repro this

I think I found the dispose issue. Try this PR out:

2 Likes

Thank you so much, docEdub, will do as soon as I can!