是否有 Createjs 的“卸载”项目preloadjs/soundjs

Is there a `unload` item for Createjs' preloadjs/soundjs

通过 createjs 将 mp3 加载到声音对象后,如何销毁它并将其从内存中清除?

为此有静态方法:

  1. removeSound: 按来源删除存储的声音引用
  2. removeSounds: 删除多个声音源
  3. removeAllSounds:擦除对声音的引用

例子

 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/");

查看 the docs 了解更多信息。

这不是一个超级常见的问题 use-case,因此如果您 运行 遇到问题,请随时在 GitHub

上提出问题