On Thu, Mar 21, 2002 at 02:47:41PM -0800, Paul Winkler wrote:
> hmm, wonder if that works  :)

Nope.

#include <math.h>
#include <stdio.h>

main() {

        int res = 44100 ;
        int length = res * 1 ; // 1 second 
        int hz = 440 ; 
        int amp = 24000 ;

        int x ;
        short out ;

        for ( x = 0 ; x < length ; x++ ) {
                out = (short)(sin( x*2.*M_PI*hz/res )*amp );
                write( ... ) ;
        }
}


Reply via email to