PortAudio  2.0
Data Structures | Macros | Typedefs | Functions
patest_sine_formats.c File Reference

Play a sine wave for several seconds. Test various data formats. More...

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

Data Structures

struct  paTestData
 

Macros

#define NUM_SECONDS   (10)
 
#define SAMPLE_RATE   (44100)
 
#define FRAMES_PER_BUFFER   (512)
 
#define LEFT_FREQ   (SAMPLE_RATE/256.0) /* So we hit 1.0 */
 
#define RIGHT_FREQ   (500.0)
 
#define AMPLITUDE   (1.0)
 
#define TEST_UINT8   (0)
 
#define TEST_INT8   (0)
 
#define TEST_INT16   (1)
 
#define TEST_FLOAT32   (0)
 
#define TEST_FORMAT   paInt16
 
#define SAMPLE_ZERO   (0)
 
#define DOUBLE_TO_SAMPLE(x)   (SAMPLE_ZERO + (SAMPLE_t)(32767 * (x)))
 
#define FORMAT_NAME   "Signed 16 Bit"
 
#define M_PI   (3.14159265)
 

Typedefs

typedef short SAMPLE_t
 

Functions

int main (void)
 

Detailed Description

Play a sine wave for several seconds. Test various data formats.

Author
Phil Burk

Macro Definition Documentation

#define AMPLITUDE   (1.0)
#define DOUBLE_TO_SAMPLE (   x)    (SAMPLE_ZERO + (SAMPLE_t)(32767 * (x)))
#define FORMAT_NAME   "Signed 16 Bit"
#define FRAMES_PER_BUFFER   (512)
#define LEFT_FREQ   (SAMPLE_RATE/256.0) /* So we hit 1.0 */
#define M_PI   (3.14159265)
#define NUM_SECONDS   (10)
#define RIGHT_FREQ   (500.0)
#define SAMPLE_RATE   (44100)
#define SAMPLE_ZERO   (0)
#define TEST_FLOAT32   (0)
#define TEST_FORMAT   paInt16
#define TEST_INT16   (1)
#define TEST_INT8   (0)
#define TEST_UINT8   (0)

Typedef Documentation

typedef short SAMPLE_t

Function Documentation

int main ( void  )