I am trying to better manage sound objects in memory by pooling, etc for HTML5 target via the Sound class.
var snd:Sound = new Sound();
snd.addEventListener( Event.COMPLETE, onLoaded );
snd.load( new URLRequest( “mysound.m4a” );
…load it, play sound and sometime later
snd = new Sound();
snd.load( new URLRequest( “mysound.m4a” ) ); //same URL path as before
But the second time I try to access the same sound object, nothing plays. Looking at the openfl.media.Sound class, I see it checks if the sound exists in the library. If it doesn’t, it passes a load call to SoundJS. If it does already exist, it triggers loadComplete automatically. On Sound.close() it appears to removes it from the library.
But my trace statements inside Sound indicate that __soundID does exist after close() is called (ie, not being removed from the library).
Any help would be awesome! I have hundreds of audio files in my game and I don’t want them ALL to be inevitably loaded in the browser cache if the user plays the whole thing in one sitting.