This example demonstrates how to play a sine wave through Pulse audio. Keep in mind that this code does NOT do any error handling. This is about the minimal amount code needed to play a sine wave.
sudo apt install libpulse-dev
gcc sine.c -o play -lm -lpulse-simple