You should know the voice-activated switch, which lights up when there is a sound, that is, it uses the voice control circuit to turn on and off, but the voice-activated switch has a time delay, and it will not be powered off for a while after the light is turned on, so as to keep people from turning off after leaving.
If this meets your requirements, the voice-activated switch can be used. If you require sound, turn it on, turn it off when it is silent, and just cancel its delay circuit.
if you are an amateur electronic technology enthusiast, you can try to build a circuit similar to a voice-activated switch yourself.