Hi there 👋
I'm glad to announce a new release of Syrinx: version 0.6
!
This version focuses on memory optimization by introducing a new optional sounds pooling capability. This feature will help to reduce the impact of the Garbage Collector
by recycling already instantiated sound instances. This new module could be pretty useful when playing a lot of identical sounds in your application (e.g. player footsteps, arrows thrown by an army of archers, etc.).
👉 Note that the pooling capability is disabled by default because it requires to be especially careful when dealing with sound instance references.
So, it can be easily enable this way:
_soundManager.isPoolingEnabled = true;
Beware: When a Sound Instance
is completed, it will be automatically returned to the pool. Therefore, be careful of not keeping references to completed Sound Instances
because they might be soon re-used somewhere else.
Infinite looping sounds (e.g. seamless looping sounds or never ending sound) can be manually returned to the pool by calling the following method:
_soundManager.releaseSoundInstanceToPool(mySound);
Important: Never destroy Sound Instances
when the pooling capability is active. This will break the objects’ recycling mechanism.
That's it! I hope this new feature will be helpful to all of you.
Changelog
- Sound Manager: Added Sound Instance pooling capability
- Sound Manager: Fixed typo in
getRegisteredTracks
method (API change)
- Demo: Updated to support the new pooling capability
- Demo: Fixed viewport
- Demo: Improved events handling
Useful links
See you around 🙂
Aurélien
PS: The archive now contains the demo packaged as a shared runtime .air
application. The AIR runtime (at least AIR 33.1
) will need to be installed to run it.