I’m working on a game called “Project PREFAB” and I made a cool menu theme song for it.
The problem is, the project media had already exceded 10MB, even though I only imported one costume and one sound. I don’t know how to check the song’s MB
Can you give me tips on how to reduce it?
.wav files are very large as they are lossless. You would have better luck exporting it as an mp3 file. If you want even lower size, AAC and Opus files are very small. Overall, I’d say mp3’s are your best bet
Try saving a measure or instrument part as a separate sound. If anything needs to repeat, it is better to make a short sound play twice instead of using one long sound.
The canonical solution to this common problem is not to include the media in the project at all, but instead have an initialization routine that uses the URL block to load the media directly from wherever you found them in the first place. There’s no limit on the size of a project while it’s running.
The problem with that is, there’s no built in way to import a sound from a url. Importing costumes is there, but it’s hidden in the extension block (which isn’t used in a library). The URL block doesn’t automatically parse the data as a sound or costume, it just returns the raw data as a string.
I feel like if you’re going to advocate for this, then there should be a library that provides easy to use blocks to import media.
P.S. Importing sounds could be in scisnap, I don’t know, but you shouldn’t need to import that huge library just to import a sound from a url.
Yeah, that’s what I was thinking. I’m planning on putting them in the web services library, since that’s related.
I’ve been working on it for a while, and got sounds to load. I did notice that the cst_load(url) extension function doesn’t handle svgs, which I’d like to do, but I’m not entirely sure how.
I should think that if the URL ends with “svg” you can call
IDE_Morph.prototype.loadSVG = function (anImage, name)
but I’m not sure, because that looks like it also puts the new costume in the current sprite’s wardrobe.
Hopefully after these COSTUME and SOUND URL blocks exist, I could use the COSTUME one (along with a URL for usernames) for my user guessing program. I tried to use “cst_load” (the extension), but as egolay_atman-bay described:
Can’t wait! Maybe even (and this may be a bit complicated), it could be a option to add a costume that saves as a link, and loads the costume itself FROM that link on startup, so a COSTUME FROM URL block won’t even be needed (although, that would still be useful)
I’m saying that what’s reported is a bitmap image of the svg, rather than an actual svg costume. You can notice the difference if you switch to that costume and increase the size of the sprite, or just add the costume to the sprite’s costumes and looking at the costumes tab, since that tells you if a costume is an svg or not.