I have seen quite a few generators and other equipment where the sound insulation foam totally disintegrated. I have also seen some RV generator setups that are many levels quieter that didn't use that garbage.
Two things make sound, one is physical vibration, the other is pressure, which can also be reflected. Think about that deeply and youll get some ideas. Like why a partially opened door isnt as load as one fully shut....Some RV/Bus generator installations aim to put a generator box, inside of a box, which dampens noise many levels further. Some are so quiet you can stand by them and barely hear them. Plain old pink foam works, and it doesnt disintegrate like foam. Get the aluminized stuff and you can seal up the seams with aluminum tape. Remember, air leaks allow sound through just as they do air. And two thin sheets of foam, separated by an air space or loose fiberglass, will absorb more sound than one thick sheet. Lead sheet works too.