I'm designing a mini game that would be generated with HTML and JS on smartphone. It would be offline and won't be able to access any files.
So I was wondering how to embed a basic music in it and some sound design.
I see 2 options :
Make a sound generator with JS, and design a sound that could play this generator (something like this link)
Convert a low-fi mp3/ogg or other to base64 and add it directly in the HTML (src="data:audio/mp3;base64...")
The first method must be the lighter but could be difficult at the moment to design the song. And maybe not that light for the hardware?
The second method would be the easier to work with but because of the amount of data I don't know if it's a good option.
Any suggestions for one of those methods? Or maybe you have a better idea?