According to your description, I estimate that the manual throttle of the old Elantra 1.6 is cable-pulled, and there is an idle contact switch on the throttle body, which means that when you don't step on the throttle, the throttle returns to turn off the idle contact switch, and then the signal of turning off the switch will be sent to the engine computer to let the computer know that the engine is in an idle state. At this time, if the air conditioner is turned on, the computer will detect the signal of turning on the air conditioner, and the engine computer will command more injectors at this time. If the throttle is completely released, but the engine computer can't receive the signal of engine idling due to the damage of idle contact switch, throttle card problem or wiring problem, then the computer will not control the idle state. If the air conditioner is turned on at this time, the fuel injector will not inject more fuel, which will lead to engine jitter or even flameout. This fault is not very difficult, you just need to check the idle speed control system.
The second question, why is it ok to play music?
As we all know, when the engine starts, the generator is responsible for the power supply of electrical equipment, and the generator also charges the battery; Then, if you turn on the music, it will directly increase the burden on the generator. At this time, if the voltage output of the generator is not improved, the demand of electrical equipment cannot be met. At this time, the engine is idling, which means that the engine speed is basically unchanged. At this time, if you want to improve the voltage output of the generator, you only need to turn on a large excitation current (this is the responsibility of a special circuit), and then the output voltage of the generator will increase.
That's your answer, but go deeper.