Is it more efficient to change the SoundId of a Sound instance or create multiple Sound instances?

I am constantly looking for the best methods for programming, unfortunately, the developer hub can be less than helpful for detailing performance implications of various instances and techniques.

I am wondering what the difference of performance implications simply utilising a single Sound instance and changing its SoundId to whatever I need on the fly, or creating multiple Sound instances with the SoundId’s I intend to use.

image
(Top being changing ID, below being using all the ID’s in seperate instances)

I would assume that for instance creation it requires more server resources than simply changing a value; but I am also wondering if there is a system in place for cacheing loaded Sound data (for instance if a SoundId is then reused later does it redownload this data?)

This is a question for purely performance reasons, however minimal it may be. If anybody has any legitimate response for which is more efficient; please assist with my question.

I feel documenting information like this around on the dev-forum can be helpful for people like me looking into deeper engine fundamentals.

2 Likes

I’ m sorry this is all i know :

  1. It is better to use single sound instance because if using multiple sound instance, then it require more resources/memory. I did test using for video using multiple video instances with asset id loaded, it rediculously utilise a lot of memory.
  2. an asset will be downloaded onto client once, then it will be stored somewhere for reuse. So, changing asset id many times for one single sound instance will not redownload the sound asset again.
1 Like