PortAudio  2.0
Data Structures | Macros | Functions
patest_latency.c File Reference

Hear the latency caused by big buffers. Play a sine wave and change frequency based on letter input. More...

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

Data Structures

struct  paTestData
 

Macros

#define OUTPUT_DEVICE   (Pa_GetDefaultOutputDevice())
 
#define SAMPLE_RATE   (44100)
 
#define FRAMES_PER_BUFFER   (64)
 
#define MIN_FREQ   (100.0f)
 
#define CalcPhaseIncrement(freq)   ((freq)/SAMPLE_RATE)
 
#define M_PI   (3.14159265)
 
#define TABLE_SIZE   (400)
 

Functions

float LookupSine (paTestData *data, float phase)
 
int main (void)
 

Detailed Description

Hear the latency caused by big buffers. Play a sine wave and change frequency based on letter input.

Author
Phil Burk philb.nosp@m.urk@.nosp@m.softs.nosp@m.ynth.nosp@m..com, and Darren Gibbs

Macro Definition Documentation

#define CalcPhaseIncrement (   freq)    ((freq)/SAMPLE_RATE)
#define FRAMES_PER_BUFFER   (64)
#define M_PI   (3.14159265)
#define MIN_FREQ   (100.0f)
#define OUTPUT_DEVICE   (Pa_GetDefaultOutputDevice())
#define SAMPLE_RATE   (44100)
#define TABLE_SIZE   (400)

Referenced by LookupSine().

Function Documentation

float LookupSine ( paTestData data,
float  phase 
)

References paTestData::sine, and TABLE_SIZE.

int main ( void  )