ZIM Docs - Aud() for #HTML #Canvas #JavaScript, #CreateJS, #ZIMjs
Channel: ZIM LEARN
Date: 2022-05-10

new Aud() is how we can play a sound on the canvas with ZIM at https://zimjs.com.  You can preload the sound in Frame() or in frame.loadAssets() using the assets and optional path parameters.  Or you can lazy-load the new Aud() without preloading.  We used to use asset() to load images, sound, JSON, SVG, etc. but in ZIM version ZIM 00 we split asset() up into the Pic(), Aud(), SVG() wrapper classes. See Docs at https://zimjs.com/docs.html?item=Aud.  Watch out for loading pics locally on the canvas - see https://zimjs.com/tips.html#SOUNDS for easy ways to avoid security errors.