Storing sounds and blocks on browser

So here's the idea: I store a block and sound into my browser using the "Database" blocks from the "Libraries" section, and then I can take that data and play it onto another project, this way I can store as much as I want without worrying about the 10MB storage issues.

However, I don't know how to do this.

Some info Sharing Variable Between Scenes? - #21 by mr_owlssssnap2

Here's how.
Convert the audio samples, or the pixels of a costume to json, then store that, as well as the audio/costume data. Here's the script

project: Snap! 7.1.2 - Build Your Own Blocks

although, this is very much uncompressed. You can compress the costume/sound much more since there's quite a lot of repeating values. I just didn't want to go to the hassle of creating a script to compress them.

although, about why you wanted this

browser storage is saved locally on your machine, in your browser, so no one else will be able to get the data, including you if you use a different browser, or another device.

What if you told someone to download the same data you had (By storing said data on a different project and making them run it to store it on THEIR browser)?

That could work.

OK, thank you very much!

like ego-lay_atman-bay say, json is the key

For another example, take a look to my project:

New database block

it's an old project, it use javascript but probably not necessary

Oups, the project don't work anymore since v7 (?), but you can get inspiration...

edit: corrected

Wait you can store sounds and blocks in browser?

If they download it on their browser, then yes, you both will have the same data.

Yes and no :wink:
Right now you can store only text so everything must be serialized.
Images/costumes can be serialized with "pixels of" reporter and "new costume".
Sounds with "samples of sound" and "new sound".
For blocks some form of codification/reverse must be used or XML format (requires JS).

oh ok

You can just store sounds in a cloud variable, right?


Also it's better storing it on browser data but have people download the data by running a project with the stuff.

Don't yell at something that doesn't need to be yelled at; it's stupid.

Just letting you know, browser storage has a limit to how much you can store in it.

School as in Replit cloud variables are blocked? You could set something up with Firebase.

Hey! I remember reply to this, but @ego-lay_atman-bay, that doesn't help with blocks.

as @dardoro said

So you'd have to include some form of codification and reverse codification to save and load blocks in browser storage. Blocks are a little harder than costumes and sounds.

oh, ok

Here's my idea on how people would use browser storage to store blocks and stuff:

Step 1: You can make some sort of "Server" project that imports the data on the user's computer browser (AKA whoever runs the project).

Step 2: Now that the browser data is on the user's browser, you can have them run the actual project.

Step 3: After that data has been used, you can do some "Garbage Collection" and delete that data.

Dude you can just use scratchmodification's block codification blocks

How do I turn them back into code blocks?