Subject: Re: [linux-audio-dev] initial (incomplete) version of ALSA Audio API tutorial
From: Kay Pruefer (pruefer_AT_informatik.uni-leipzig.de)
Date: Fri Mar 22 2002 - 03:55:59 EET
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( ... ) ;
}
}
This archive was generated by hypermail 2b28 : Fri Mar 22 2002 - 03:42:21 EET