Silencer for pipes to minimize noise pollution