How to create sound when physics object moves?

I managed to create a simple door, which uses realtime physics to open when the player pushes it by walking in it and then closes. I used a physics constraint as a hinge and as a “handle”(so the door goes back to place after a short time). The problem I face is that I want the door to play a creaking sound when it opens, and the sound should advance based on the angle. I’m not even sure if it is possible, currently I have had no idea. Does anyone know how?