add msvc build to libteletone

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@632 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris
2006-02-19 21:24:29 +00:00
parent cf67dbefd4
commit 51f566fbd4
6 changed files with 206 additions and 1 deletions

View File

@@ -53,6 +53,14 @@ typedef struct {
teletone_process_t freqs[TELETONE_MAX_TONES];
} teletone_tone_map_t;
#if !defined(M_PI)
/* C99 systems may not define M_PI */
#define M_PI 3.14159265358979323846264338327
#endif
#ifdef _MSC_VER
#define int16_t __int16
#endif
#include <libteletone_generate.h>
#include <libteletone_detect.h>

View File

@@ -51,7 +51,9 @@
* detriment.
*/
#include <math.h>
#ifndef _MSC_VER
#include <stdint.h>
#endif
#include <string.h>
#include <stdio.h>
#include <time.h>

View File

@@ -161,7 +161,7 @@ int teletone_mux_tones(teletone_generation_session_t *ts, teletone_tone_map_t *m
for (i = 0; i < freqlen; i++) {
sample += ((teletone_process_t) 2 * (ts->volume > 0 ? ts->volume : 1) * cos(tones[i] * ts->samples * period));
}
ts->buffer[ts->samples] = sample;
ts->buffer[ts->samples] = (teletone_audio_t)sample;
for (c = 1; c < ts->channels; c++) {
ts->buffer[ts->samples+1] = ts->buffer[ts->samples];

View File

@@ -38,7 +38,9 @@ extern "C" {
#include <stdio.h>
#include <string.h>
#include <math.h>
#ifndef _MSC_VER
#include <unistd.h>
#endif
#include <fcntl.h>
#include <sys/types.h>
#include <errno.h>