Due to the remarkable noise attenuation and the stability of flowing inside the straight channel which causes a lower pressure drop, the perforated muffler system is widely applied in industrial venting systems and automobiles. Research on new techniques of perforated silencers has been well addressed and developed; however, the research work in shape optimization for a volume-constrained silencer requested upon the demands of operation and maintenance inside a constrained machine room is rare. Therefore, the main purpose of this paper is not only to analyze the sound transmission loss of a one-chamber perforated muffler but also to optimize the best design shape under space-constrained conditions. In this paper, both the generalized decoupling technique and plane wave theory are used. The four-pole system matrix in evaluating the acoustic performance of sound transmission loss (STL) is also deduced in conjunction with the novel genetic algorithm (GA); moreover, numerical cases of sound elimination with respect to pure tones (150, 250, 350, 450, 550, 650, 750, 850, 950 Hz) are fully exemplified and discussed individually. To achieve a better optimization in GA, several test parameter values were used. Before GA operation can be carried out, the accuracy of the mathematical models has to be checked by Crocker's experimental data. The results reveal that the maximum value of sound transmission loss (STL) can be optimally and precisely obtained at the desired frequencies. The approach used for the optimal design of the STL proposed in this study is indeed easy and quite effective.