Introduction - If you have any usage issues, please Google them yourself
This example programme creates a wav file, with 30 seconds of a 440Hz tone. The source file can be downloaded using the link below.
writeWav.c
It is compiled and executed as follows:
> gcc -lm -lsndfile -o writeWav writeWav.c
> ./writeWav output.wav