Currently, when I add an audio source to my project it crashes. I believe it’s because some memory limit is being reached. I know I can remove models or downscale textures but I’d like to be able to get a sense of the tradeoffs I’m making. Is there a way to tell how many resources the audio is taking up? I know I can see the size of the audio file, but I’m not sure how that translates when the sound is actually playing. Is there a part of the profiler I’m missing, or one which includes the Audio that I’m not aware of? Thanks!
How big is the audio file? I’ve not seen a case where adding a audio would crash the browser or app
It’s 2 minutes long, I know that’s kind of long for playcanvas but I wanted to put it in as a test first
Hi @Ezra_Szanton,
What is the file size of the audio clip? I have 5 minute videos in my projects that don’t manage to crash the app. Are you receiving any errors in the console?
I’m sure that it wouldn’t be an issue on it’s own, the project is very large besides the audio so I’m sure it’s everything combined that does it in. I just get the “aw snap, something went wrong” error page.
Hi @Ezra_Szanton,
Without playing with the project it would be hard to say. You might get lucky with Chrome’s logging features:
To quote Stackexchange:
- Use Chrome’s logging feature:To enable logging, launch Chrome with these command line flags:
--enable-logging --v=1
The output will be saved to the filechrome_debug.log
in Chrome’s user data directory.The location of the log file can be overridden byCHROME_LOG_FILE
environment variable.For full list of flags, check: Google Chrome command line switches.
Thanks for the tip, unfortunately I don’t think it’ll be that useful for this project because the scene I’m trying to debug has XR in it that means it’s only playable on a phone.
Can you connect remotely to your phone via devtools and see if you can get any errors/logs to help https://developer.chrome.com/docs/devtools/remote-debugging/
Does it crash with a much shorter audio clip?
In a new project, does the audio clip you are using crashing on its own?
Good ideas, thank you. It does not crash with a 1 second clip, it also plays fine in a different scene without everything else in it. I think I’ll try playing around until I get a sense for how big of a clip I can put in there without breaking it.
I find it really odd that a mp3, no matter how long can crash the app.
You can check browser memory usage in devtools. eg: https://developer.chrome.com/docs/devtools/memory-problems/
I find it odd too, I’m a little out of my depth on the web profiling stuff, is there anything in particular I should be looking for?
Memory heap size, memory allocations, overall memory usage etc.
I gave profiling the memory usage my best shot. I’ve included a bunch of errors that I got (I didn’t always get them, sometimes they would pop up and sometimes they wouldn’t). I was also unable to find the loading of the music at all, besides the errors. I’m not sure if I just wasn’t looking in the right place, or maybe it didn’t get logged because it crashes when it tries to load it. After everything though, it seems like the 503,525 kB is the nail in the coffin right? Maybe the music just pushed it over the edge? Thanks for all your help so far! What do you think? (I also saved the full heap file I can DM it to you if you want to comb through yourself)

500MB is pretty high. How much memory is used without the audio file?
Can you also open the PlayCanvas profiler and scroll down to see how much VRAM is used? https://developer.playcanvas.com/en/user-manual/optimization/profiler/
Turns out it was just the scene it was in, whoops! At least I know how the chrome dev tools work now. Thanks for all your help, I really appreciate it.