Laptop charger makes weird noise and turns off laptop after plugging in (help)


Dec 15, 2015
I have a Medion Erazer X laptop for a little longer than a year now. Today while i was coding something for school i noticed that my laptop wasn't charging anymore for a short periode of time.
Before i could even check if the cables were plugged in correctly my laptop continued charging like normal. I thought it was weird, but i didn't think much of it so i carried on doing what i was doing.
A few minutes later, the same thing happned. Only this time, it would charge for like 5seconds and then not charge for like 20 seconds, continuesly.
At that moment i decided to inspect my adapter and battery, when i removed my headset from my ears i instantly noticed this weird, high pitched robot-like peeping sound coming from my adapter. When i unplugged the thing from my laptop the sound stopped. Also i was expecting the adapter to be unusually warm or something but it wansn't. I gave up looking for something unusual about the cable or the adapter and i plugged it back in to my laptop when this happned.
The adaptor was making no sound at all but my laptop wasn't charging either, after about 5 seconds the damn thing startend making sound and my laptop just shuts down like that.
Also, in the current situation. if plugged in while my laptop is turned off i can see the charging indicator LED turning on Every 5-6 seconds and turning off again after that, then not charging for 5-6 seconds and then charging again repeatedly.
I also noticed that the adaptor wil only make the weird sound when charging the laptop (when the LED is lit). But it won't charge continuesly. I don't think it's safe to charge my laptop now, can anyone tell me what to do? I really hope it's just the charger i need to replace.. I need my laptop for school.. Thank you for your time :)