Single supply opamp with AC coupling
Because there is no load on the capacitor, there is no current to charge the capacitor, and there will be 0V over the capacitor. If the op-amp output has a DC bias of 6V, so will the other side of the capacitor as well. When you put the resistor from capacitor output to ground, it sets the ouput DC bias and lets current flow via capacitor to charge it so there will be 6V over the cap.
After trying different things I found out that adding a 1K resistor to the ground after the last capacitor seems to fix it, but I can't really understant why. Is it the right way to do it ? Why 1K ?
It needn't be 1 kohm. It could just as well be 10 kohm or 100 kohm or 1 Mohm. The 10 uF capacitor and the output resistor form a high pass circuit. This means they let high frequencies through and block low frequencies. At 0 Hz, the DC is fully blocked. The point where the output signal power reduces by half is called the cut off frequency and is defined as: -
$$F_C = \dfrac{1}{2\pi RC}$$
So, with 1 kohm and 10 uF the cut-off frequency is 15.9 Hz and fine for audio.
I only got TL072, would this work ? I assume that it would be a problem if I used a very low power supply (like 5V) for my opamp but should be OK with a 12V supply, am I wrong ?
Yes, the TL072 would work OK but because the output isn't "rail-to-rail" you will see clipping if your output signal rose above about 8 volts peak-to-peak.
Technically an op amp that normally is powered by dual supply can be used in single supply if input and output signals are small enough and don’t go to rail voltages. That is if you power off 12V and set input and output at 6V where input is 1Vpp and output is 2Vpp then your fine since you’ve got plenty of headroom. In other applications where you’d like to have small power supply and use as single supply to amplify ac signal with ac coupling then you might run into trouble with setup I mentioned. In this case your best option is a single supply rail to rail op amp. Even if you didn’t use lower Olathe for power supply but just wanted more range to output and input the then rail to rail op amp would be ideal anyway. Soothing like opa340 for low power and TLV271 for higher voltages are good single supply rail to rail input and output op amps with ok bandwidth. If you wanted more bandwidth then you can find others on DigiKey. Just look for rail to rail input output op amps.
TL072 would work if you use Vcc of 12V and keep input and output voltage swings smaller than max input and output range specified in Datasheet.
Reason your signal was not ac coupled at output is because you have no load resistor. Meaning output was connect to very high impedance and almost capacitor like load. When two capacitors are in series with voltage across them, the midpoint will also have DC voltage. To solve this you should place a load like 10kohm.