Here are a few things you could try:
Restart your device (turn off and on again)
Reset your iPad (press and hold Home and Power button at the same time until the Apple logo appears)
Delete apps running in the background (double press Home button to reveal the multitask bar, then press and hold an app until it wiggles, remove all apps from there)
Reset all settings in Settings - General - Reset - Reset All Settings
If you used headphones, plug them in again, leave them there for some time and then remove them. Sometimes this will help.
"Riches can be lost, but happiness in your heart can only be veiled, and it will still bring happiness again, as long as you live." Anne Frank
It could be your headphones or the headphone port
Try swapping out the headphones, to see if that works.
If it still doesn't work try bluetooth headsets to see if you can bypass the port.