   manipulate sound waves, (input, output)
  hi,does any one know, how can I transform a sinusoidal function, into a sound wave that I can play through the speakers.   
  Here's one way to do it in SDL using SDL_mixer.  I used a frequency modulated sweep as an example.  It assumes a sampling rate of 44100 Hz and 16-bit signed sample format.#define LOWFREQ 55.0#define HIGHFREQ (double)speed// Build the sample from some simple parametersvoid buildSample() {    Uint16 *bufferIndex=NULL;    int i;    sample=(Mix_Chunk *)malloc(sizeof(Mix_Chunk));    if (sample==NULL) {   fprintf(stderr, "Out of memory");   exit(4);    }    sample->allocated=1;    sample->alen=bufSize;    sample->abuf=(Uint8 *)malloc(bufSize);    if (sample->abuf == NULL) {   fprintf(stderr, "Out of memory");   free(sample);   exit(4);    }    sample->volume=MIX_MAX_VOLUME;    bufferIndex=(Uint16 *)(sample->abuf);    int sampLength=bufSize>>1; // length in 16-bit samples    for (i=sampLength; i > 0; i--) {   double time = (double)i/44100.0;   double freq = LOWFREQ + i * (HIGHFREQ - LOWFREQ)/sampLength;   double sinValue = sin(M_PI*freq*time*2.0);   *bufferIndex++ = (Sint16)(sinValue*32767.0);    }} // end of buildSampleIf you want to do a simple sine wave then get rid of all the frequency sweeping and set freq to be a constant.   ;  is there a possibility of doing this efficiently using somekind of windows api or so?   ;  Not on my hard drive, but somebody should have something.  The code that I posted before was adapted from another source in Java.Just remember that a sample is an array of levels of compression in the air.  A sine wave is the simplest vibration you can do other than a square wave.  Most sound cards use CD-quality sound nowadays so it would just be a matter of filling up an array of signed 16-bit integers (unsigned short in C/C++) and passing them to the operating system.   