Using a ZIM AudioSprite

Here is an example of using an AudioSprite. There are other formats too see https://zimjs.com/audiosprite.

2 Likes

Cool! so maybe also example for a picture sprite with jsondata visible.
you have made this dr.Abstract example with json data external link to .json file

so spritedata can be also intern coded in ZIM file like this way as audioSpriteData
I found your code in this vide https://youtu.be/5cvF2eUdbiw?si=ggGY5pElE2UhEpJW

Thanks to add AudioSprite an JsonSprite visual understanding simple :slight_smile:

JSON format is a string so can be used anywhere like a string. We usually keep the Sprite data, for instance, from TexturePacker, in a remote JavaScript file so the data does not clutter the app file.

The AudioSprite data, in this case, is an Object Literal. We could have kept this data in a remote file too - a remote .js file. Or stored it as a JSON string and then parsed it. But the AudioSprite data but it is not that much and it helps us remember what to call the sounds so we left it in the app file.

1 Like