patest_stop.c File Reference
Test different ways of stopping audio.
More...
#include <stdio.h>
#include <math.h>
#include "portaudio.h"
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 <philburk@softsynth.com>
Define Documentation
#define FRAMES_PER_BUFFER (256) |
#define FRAMES_PER_NOTE (SAMPLE_RATE/2) |
#define FUNDAMENTAL (400.0f / SAMPLE_RATE) |
#define LATENCY_SECONDS (3.f) |
#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()) |
#define SAMPLE_RATE (44100) |
Function Documentation
float LookupWaveform |
( |
paTestData * |
data, |
|
|
float |
phase | |
|
) |
| | |
References LATENCY_SECONDS, M_PI, MODE_ABORT, MODE_FINISH, MODE_STOP, NOTE_0, NOTE_1, NOTE_2, NOTE_3, NOTE_4, paTestData::notesPerTune, paNoError, paTestData::stopMode, TABLE_SIZE, TestStopMode(), paTestData::tune, and paTestData::waveform.
References PaStreamParameters::channelCount, PaStreamParameters::device, paTestData::done, paTestData::frameCounter, FRAMES_PER_BUFFER, PaStreamParameters::hostApiSpecificStreamInfo, LATENCY_SECONDS, MAX_REPEATS, MODE_ABORT, MODE_FINISH, paTestData::noteCounter, OUTPUT_DEVICE, Pa_AbortStream(), Pa_CloseStream(), Pa_GetErrorText(), Pa_Initialize(), Pa_IsStreamActive(), Pa_OpenStream(), Pa_Sleep(), Pa_StartStream(), Pa_StopStream(), Pa_Terminate(), paClipOff, paFloat32, paNoError, paTestData::phase, paTestData::phase_increment, paTestData::repeatCounter, SAMPLE_RATE, PaStreamParameters::sampleFormat, SLEEP_DUR, paTestData::stopMode, PaStreamParameters::suggestedLatency, and paTestData::tune.
Referenced by main().