Play a sine wave for several seconds, pausing in the middle. Uses the Pa_GetStreamTime() call.
More...
#include <stdio.h>
#include <math.h>
#include "portaudio.h"
#include "pa_util.h"
◆ FRAMES_PER_BUFFER
#define FRAMES_PER_BUFFER (64) |
◆ M_PI
#define M_PI (3.14159265) |
◆ NUM_LOOPS
◆ NUM_SECONDS
#define NUM_SECONDS (8.0) |
◆ SAMPLE_RATE
#define SAMPLE_RATE (44100) |
◆ TABLE_SIZE
◆ TWOPI
#define TWOPI (M_PI * 2.0) |
◆ main()
References PaStreamParameters::channelCount, PaDeviceInfo::defaultLowOutputLatency, PaStreamParameters::device, paTestData::frameCount, FRAMES_PER_BUFFER, PaStreamParameters::hostApiSpecificStreamInfo, NUM_LOOPS, NUM_SECONDS, paTestData::outTime, Pa_CloseStream(), Pa_GetDefaultOutputDevice(), Pa_GetDeviceInfo(), Pa_GetErrorText(), Pa_GetStreamTime(), Pa_Initialize(), Pa_OpenStream(), Pa_Sleep(), Pa_StartStream(), Pa_StopStream(), Pa_Terminate(), paClipOff, paFloat32, paNoDevice, paNoError, paTimedOut, SAMPLE_RATE, PaStreamParameters::sampleFormat, and PaStreamParameters::suggestedLatency.