I'm loading two 300MB MP3 files in an AudioBuffer
and then proceed to encode them as WAV files. Somewhere along the process of encoding (which happens in a web worker), the browser crashes because of a lack of memory.
WAV files are about 3 times larger than MP3 files, so it would need ~1.8GB additional space to do the conversion.
The files can have any size, because they are mp3 files that the user chose to upload, so they can be 10MB or 350MB. This means that the memory may or may not be sufficient. In case that it isn't sufficient, how do I simply catch and handle the error instead of having the browser crash?
I would limit the user to a specific project (all files combined) size, but it seems like the maximum memory limit varies with the OS, OS architecture, browser version and browser architecture which makes it almost impossible to define such limit.