The right size freeze plugs, brass tubing and some lathe time.
That said, my unit had them in Viet Nam; not nearly as quiet as shown on TV.
With the gas valve closed, the AR still breaks the sound barrier.
It does moderate the sound and makes the direction of the source difficult to determine.
You can make a really good one from an old B&S lawnmower muffler.........................
I remember when I was in grade school, this kid said his older brother had an AK-47 with a silencer and they shot it off in an alley and it just sounded like “a woosh of air”.
When I eventually learned that “silencers” merely reduced rather than nearly eliminated sound (like on TV) I remembered that kid’s story and knew he was full of it.