PortAudio 2.0
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)
 
#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

◆ CalcPhaseIncrement

#define CalcPhaseIncrement ( freq)
Value:
((freq)/SAMPLE_RATE)
#define SAMPLE_RATE
Definition patest_latency.c:50

Referenced by main().

◆ FRAMES_PER_BUFFER

#define FRAMES_PER_BUFFER   (64)

Referenced by main().

◆ M_PI

#define M_PI   (3.14159265)

Referenced by main().

◆ MIN_FREQ

#define MIN_FREQ   (100.0f)

Referenced by main().

◆ OUTPUT_DEVICE

#define OUTPUT_DEVICE   (Pa_GetDefaultOutputDevice())

Referenced by main().

◆ SAMPLE_RATE

#define SAMPLE_RATE   (44100)

Referenced by main().

◆ TABLE_SIZE

#define TABLE_SIZE   (400)

Referenced by LookupSine(), and main().

Function Documentation

◆ LookupSine()

float LookupSine ( paTestData * data,
float phase )

References paTestData::sine, and TABLE_SIZE.

◆ main()