The watermark embedded by traditional methods is easy to be lost under some attacks. To overcome this problem, this study proposes a novel method based on DWT. It adopts a digital audio watermarking state-switching system which optimizes DWT coefficients doubly. Firstly, it combines the quantization-embedding system and the weights of DWT coefficients with SNR to obtain an optimization model for watermarking. Next, the Lagrange principle, Hessian matrix, and minimum energy play three essential roles to obtain the optimal DWT coefficients and weights. Moreover, the almost invariant feature of the optimal weights holds demonstrating resistance to amplitude scaling. Compared with similar algorithms, the experimental results verify that the embedded audio in the proposed method has higher signal-to-noise ratio (SNR) and lower bit error rate (BER). At the same time, it indicates stronger robustness against various attacks, such as re-sampling, amplitude scaling, and mp3 compression.