/*
          __
         / /_______________  ____  ___
        / __/ ___/ ___/ __ \/ __ \/ _ \
       / /_(__  ) /__/ /_/ / /_/ /  __/
       \__/____/\___/\____/ .___/\___/
                         /_/

    newsound3.c
    record, play and save a wav file (blocking API)
    (no need to open a graphics window)
*/

#include <tscope.h>

int main()
{
    // make a sample pointer
    snd2_sample *samp;

    // allocate memory for a 2000 ms recording
    samp=snd2_makesample(2000);

    // record the sample
    snd2_recordsample_blocking(samp);

    // play the sample
    snd2_playsample_blocking(samp);

    // save the sample to disk
    snd2_writesample(samp, "test.wav"); 
    
    // kill the sample
    snd2_killsample(samp);

    return 0;
}
END_OF_MAIN();



top
Persoonlijke pagina Universiteit GentTscope
Allegro | Cygwin | Gcc
© See license.html for copyright information