Can I export a project which could run on IE11 without WebAudio

Because we don’t use any audio/sound functions in the whole project. And we expect that our project could run on IE11. I know WebGL use il2cpp to generate final js file. It should be something like static link. So, any modules never used should not be compile into final js. I’ve tried to disable Audio in Editor but the size of js file is not changed. We also want to make the js file smaller to get a faster loading.

Anyone could help us?

Thanks

Your WebGL content without audio should work in IE as is. how does it fail for you?

Hi Jonas,

We are also having this issue. We would like to export out projects without audio that will work with IE11. In my current scene, I have no audio whatsoever and I even deleted the audiolistener on the camera. Still can’t get the scene to work.

Is there a way to make sure there is absolutely NO audio being written into the file whatsoever? I have a feeling the audio is “stealthily” still considered to be on, despite having no objects with audio.

I am using Unity Pro, by the way.

Thank you!

I think the WebGL build adds the WebAudio API. I have been hunting how to remove this myself. Please share if you figure it out.

Update; we’ve tried exports where ive even gone into edit-project settings-audio and checked “Disable Audio” and we still cannot get it to work. No audio objects, no audio listener, and “Disable Audio” checked in the project settings…is there anyone out there who’s actually gotten Unity to work in IE? Do you have to do anything special on the server side to get things to work?

As I asked before, how does it fail for you?

You have to tell us what the error message is. I can create builds that run just fine in IE11 without audio.

I can’t speak for @Multiad , but I have a similar experience that I’d like to solve. Here is the error I get with IE11. This is with any audio element I could find removed before the build.

I’ve been experimenting with a few different builds and in my most recent build I get the error that states “Please note that your browser is not currently supported for this Unity WebGL content. Try installing Firefox, or press okay if you wish to continue anyways”. Which is odd because I definitely have the most up to date IE. One of our web guys here is having issues as well, im currently corresponding with him to figure out the problems on his end.

@troy_halsey1 you appear to be closer than I am to getting a working result. Are you using any specific build settings to get to the point where you’re at (like a certain level of stripping, build speed, etc)?

@Multiad - Yes, I get that error too with IE11…you just have to say okay and it should continue loading. Someone posted how to turn that off, but I haven’t tried it yet. The error I posted is what I get even after that first error…after it downloads everything. This happens during parsing I believe.

Any stripping is fine, they are all the same. Always use the slowest build option…and turn off error handling.

Follow-Up…if I click okay on the error message I posted it finally loads. I hadn’t tried this in a while, so I stopped on the second error (which used to freeze IE). So…other than annoying error messages, it does technically work on IE11.

IE isn’t officially supported, though it works without WebAudio. It actually would probably be fairly trivial to remove those error messages as they should be contained in the generated javascript. You’ll just need to search the generated code and modify the javascript. This would only be possible in the uncompressed version so you’d have to make the manual modification and then gzip the files yourself. I could actually write you a Windows utility that would gzip the uncompressed version if you wanted, though I’d do it quick and dirty using .NET’s GZipStream so it might not achieve the same compression level and might be better looking for a 3rd party utility.

After clicking okay I just get a blank screen. One thing I just noticed btw; even when checking the “Disable Audio” checkbox in my scene, the audio appears to still be using memory when I check my scene stats in the Profiler.

@Multiad It’s probably part of the engine and there are bits of it that can’t be disabled, just a guess. As to the blank screen, open up your browser developer tools (F11 in IE) and start capturing in the Network tab and then click refresh. Chances are your .mem, .data (or .memgz and .datagz if you’re using compressed) are not being served properly. They need to be coming down as application/octet-stream and if you’re using the .*gz versions you’ll need the gzip header as well.

Yes, I agree. I think the webAudio is built in…I wish they would make that an option on the build to remove. To keep the parsing time down, Unity needs to let us remove API elements like we are trying to lighten a life raft. Keep throwing things overboard till it doesn’t work.

@Dustin-Horne - I’d be interested in that gzip compression tool you mentioned. We are trying to move quickly into the WebGL arena, and I’m hungry for any tools I can get my hands on.

Actually I just realized 7-Zip supports this.

Right click file → Add to Archive
Archive Format: change to gzip
set your compression level

You’ll also need to rename your file from yourGame.js.gz to yourGame.jsgz.

2111846--138546--gzip.png

1 Like

Awesome sauce…nice work @Dustin-Horne

You’re very welcome. :slight_smile:

@troy_halsey1 , what is your WebGL Memory Size set to? I’m wondering if that is my problem. Beforehand, I had it set fairly high.

and btw, is there a good way to test WebGL offline using IE? I can get webgl files to open locally with firefox but nothing else. I’ve heard there are ways to run your own fake server locally, but I’m not sure how to do that.

There are ways. If you’re running Windows 7 Pro (or 8.0 / 8.1 Pro) you can use IIS locally and configure the MIME types via the Internet Information Services Manager. If you’re not running Pro, you can use IIS Express but it’s a more manual process to setup and use.