Asset Packaging

Can you make the music files smaller? What is the type of file you’re using for music?

For flash target I use all mp3, soundfx and music. For other targets I use ogg. I optimize in Audacity to make them small as I can with good quality, and if you don’t need stereo, convert them to mono and it’s basically half the size.

I tend to go with shorter music lengths, which also affects the file size.

The music is ogg format. Not really sure making the music shorter is a valid option.

If you write the files into bytes somewhere, then it should be possible to read them into memory and load that way. We (honestly) should do some sort of “asset.pak” solution built-into the Lime tools, but it just hasn’t been implemented yet. Most of the architecture is there for it, though

The “Buffer.add” issue is an error in the Haxe compiler, not expecting to embed quite so many haxe.Resource files

What class do I need to be looking at to do byte conversions? I see the ByteArray class is, at the very least, what the Assets class loads in, but its not readily apparent how I would translate a music file to and from bytes.

When you open a file (such as sys.io.File/loadBytes) it will be bytes already.

We also support static fromBytes or loadFromBytes methods for most asset types. For example, BitmapData.loadFromBytes

Is there a (general purpose) tutorial I could refer to on working with bytes? Seriously, I’m a total green at working with them in higher-level languages.

The ByteArray section of this tutorial might help: http://www.adobe.com/devnet/actionscript/learning/as3-fundamentals/vectors-and-bytearrays.html

Please feel free to ask any specific questions here :slight_smile:

Ah, all right. Thanks again for the help. :slight_smile: