A shock wave generated at 30,000 feet at Mach 1 cannot be heard on the ground for precisely the reason you surmise in your comment.
The US Air Force has conducted tests with supersonic aircraft and has this to say:
Under standard atmospheric conditions, air temperature decreases with increased altitude. For example, when sea-level temperature is 58 degrees Fahrenheit, the temperature at 30,000 feet drops to minus 49 degrees Fahrenheit. This temperature gradient helps bend the sound waves upward. Therefore, for a boom to reach the ground, the aircraft speed relative to the ground must be greater than the speed of sound at the ground. For example, the speed of sound at 30,000 feet is about 670 miles per hour, but an aircraft must travel at least 750 miles per hour (Mach 1.12, where Mach 1 equals the speed of sound) for a boom to be heard on the ground.