Look in that "cool demos in blitz" thread in the general forum. My pong example near the bottom of the thread uses this function to write a wave file header and then fills the file with a 16 bit 44khz sound effect which I generate dynamically.
The file shows how to make a ping noise with a sine wave, and static, both of which fade out over time. The code is kinda messy though. And I'm not entirely positive I wrote the sine wave out to the file properly. Sounds kinda harsh. But it's a start. :-)
Oh and 8 bit sounds vary from -127 to 128. 16 bit goes from -32767 to 32768.
The file shows how to make a ping noise with a sine wave, and static, both of which fade out over time. The code is kinda messy though. And I'm not entirely positive I wrote the sine wave out to the file properly. Sounds kinda harsh. But it's a start. :-)
Oh and 8 bit sounds vary from -127 to 128. 16 bit goes from -32767 to 32768.