Solid-state Thermoacoustics: Theory, Formulation, and Device Optimization