This code is not made by any PulseAudio developer. It may not be best practice, but it seems to work and could be used as a start for a playback application that uses the async API.

This simple application plays a constant note and uses a low latency setup (20 ms) that should be suitable for games. It also increases the latency when underruns are detected, this makes it possible to get good sounding playback over networks as well.