Generating sound files in C