From 4deee2187194f1747158e51e0ac7198f5a24f8e8 Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 11 Aug 2005 14:48:42 +0000 Subject: Let's generate a valid sample for our wave form git-svn-id: http://svn.digium.com/svn/zaptel/trunk@731 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- fxotune.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fxotune.c b/fxotune.c index 04f89ed..07fb834 100755 --- a/fxotune.c +++ b/fxotune.c @@ -34,7 +34,7 @@ #define BUFFER_LENGTH 8000 /* 4000 sample buffers */ #define SKIP_BYTES 1600 -#define PI 3.14 +static const float loudness = 16384.0; static char *zappath = "/dev/zap"; static char *configfile = "/etc/fxotune.conf"; @@ -56,7 +56,7 @@ static int debug = 0; * Returns a 16bit slinear sample. */ static short inline gentone(int hz, int index) { - return sinf(index * 2 * PI * hz/8000); + return loudness * sin((index * 2.0 * M_PI * hz)/8000); } /* Returns the power of the buffer of samples in 16bit slinear format. -- cgit v1.2.3