0

Once you've loaded a mp3 into a sound object via createjs, how dow you destroy & clear it from memory?

tolmark
  • 1,746
  • 1
  • 13
  • 19

1 Answers1

1

There are static methods for this:

  1. removeSound: Remove stored references to sounds by source
  2. removeSounds: Remove multiple sound src's
  3. removeAllSounds: Wipe references to sounds

Examples

 createjs.Sound.removeSound("myID");
 createjs.Sound.removeSound("myAudioBasePath/mySound.ogg");
 createjs.Sound.removeSound("myPath/myOtherSound.mp3", "myBasePath/");
 createjs.Sound.removeSound({mp3:"musicNoExtension", ogg:"music.ogg"}, "myBasePath/");

Check out the docs for more info.

This is not a super common use-case, so if you run into issue, please feel free to open an issue on GitHub

Lanny
  • 11,244
  • 1
  • 22
  • 30