Recent research has discovered that origami-inspired structures possess great versatility in properties and functionalities. In this research, through an integration of origami geometry and duct acoustics, we reveal that the folding-induced shape reconfiguration of a modular origami silencer could yield great tunability and programmability in sound attenuation. This has been made possible through exploring the kinematics of the folding and the extensibility of the modular origami. Numerical and experimental results indicate that by reconfiguring the silencer via a single degree-of-freedom folding mechanism, the sound attenuation bandwidth can be effectively tuned. Meanwhile, based on a comprehensive understanding on the correlations between the origami geometries and the acoustic characteristics, we exemplify that, by incorporating multiple origami layers in a silencer and by programming their geometries, ondemand sound control can be achieved, e.g., attenuation in the prescribed frequency bands, improved attenuation levels, and broadband attenuations. This proof-of-concept study shows that the proposed folding-based mechanism, along with the modularization design concept, would provide a new way to reconfigure the silencer for acoustic adaptability and inspire new innovation in designing acoustic devices.