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

Test different ways of stopping audio. More...

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

Data Structures

struct  paTestData
 

Macros

#define OUTPUT_DEVICE   (Pa_GetDefaultOutputDevice())
 
#define SLEEP_DUR   (200)
 
#define SAMPLE_RATE   (44100)
 
#define FRAMES_PER_BUFFER   (256)
 
#define LATENCY_SECONDS   (3.f)
 
#define FRAMES_PER_NOTE   (SAMPLE_RATE/2)
 
#define MAX_REPEATS   (2)
 
#define FUNDAMENTAL   (400.0f / SAMPLE_RATE)
 
#define NOTE_0   (FUNDAMENTAL * 1.0f / 1.0f)
 
#define NOTE_1   (FUNDAMENTAL * 5.0f / 4.0f)
 
#define NOTE_2   (FUNDAMENTAL * 4.0f / 3.0f)
 
#define NOTE_3   (FUNDAMENTAL * 3.0f / 2.0f)
 
#define NOTE_4   (FUNDAMENTAL * 2.0f / 1.0f)
 
#define MODE_FINISH   (0)
 
#define MODE_STOP   (1)
 
#define MODE_ABORT   (2)
 
#define M_PI   (3.14159265)
 
#define TABLE_SIZE   (400)
 

Functions

int TestStopMode (paTestData *data)
 
float LookupWaveform (paTestData *data, float phase)
 
int main (void)
 

Detailed Description

Test different ways of stopping audio.

Test the three ways of stopping audio:

A long latency is set up so that you can hear the difference. Then a simple 8 note sequence is repeated twice. The program will print what you should hear.

Author
Phil Burk philb.nosp@m.urk@.nosp@m.softs.nosp@m.ynth.nosp@m..com

Macro Definition Documentation

#define FRAMES_PER_BUFFER   (256)

Referenced by TestStopMode().

#define FRAMES_PER_NOTE   (SAMPLE_RATE/2)
#define FUNDAMENTAL   (400.0f / SAMPLE_RATE)
#define LATENCY_SECONDS   (3.f)

Referenced by TestStopMode().

#define M_PI   (3.14159265)
#define MAX_REPEATS   (2)

Referenced by TestStopMode().

#define MODE_ABORT   (2)

Referenced by TestStopMode().

#define MODE_FINISH   (0)

Referenced by TestStopMode().

#define MODE_STOP   (1)
#define NOTE_0   (FUNDAMENTAL * 1.0f / 1.0f)
#define NOTE_1   (FUNDAMENTAL * 5.0f / 4.0f)
#define NOTE_2   (FUNDAMENTAL * 4.0f / 3.0f)
#define NOTE_3   (FUNDAMENTAL * 3.0f / 2.0f)
#define NOTE_4   (FUNDAMENTAL * 2.0f / 1.0f)
#define OUTPUT_DEVICE   (Pa_GetDefaultOutputDevice())

Referenced by TestStopMode().

#define SAMPLE_RATE   (44100)

Referenced by TestStopMode().

#define SLEEP_DUR   (200)

Referenced by TestStopMode().

#define TABLE_SIZE   (400)

Referenced by LookupWaveform().

Function Documentation

float LookupWaveform ( paTestData data,
float  phase 
)

References TABLE_SIZE, and paTestData::waveform.

int main ( void  )
int TestStopMode ( paTestData data)