Play a sine wave for several seconds. Start and stop the stream multiple times.
More...
#include <stdio.h>
#include <math.h>
#include "portaudio.h"
Play a sine wave for several seconds. Start and stop the stream multiple times.
- Author
- Ross Bencina rossb.nosp@m.@aud.nosp@m.iomul.nosp@m.ch.c.nosp@m.om
-
Phil Burk philb.nosp@m.urk@.nosp@m.softs.nosp@m.ynth.nosp@m..com
◆ FRAMES_PER_BUFFER
#define FRAMES_PER_BUFFER (400) |
◆ M_PI
#define M_PI (3.14159265) |
◆ NUM_LOOPS
◆ NUM_SECONDS
◆ OUTPUT_DEVICE
◆ SAMPLE_RATE
#define SAMPLE_RATE (44100) |
◆ TABLE_SIZE
◆ main()
References PaStreamParameters::channelCount, PaDeviceInfo::defaultLowOutputLatency, PaStreamParameters::device, FRAMES_PER_BUFFER, PaStreamParameters::hostApiSpecificStreamInfo, paTestData::left_phase, M_PI, NUM_LOOPS, NUM_SECONDS, OUTPUT_DEVICE, Pa_CloseStream(), Pa_GetDeviceInfo(), Pa_GetErrorText(), Pa_Initialize(), Pa_OpenStream(), Pa_Sleep(), Pa_StartStream(), Pa_StopStream(), Pa_Terminate(), paClipOff, paFloat32, paNoDevice, paNoError, paTestData::right_phase, SAMPLE_RATE, PaStreamParameters::sampleFormat, paTestData::sine, PaStreamParameters::suggestedLatency, and TABLE_SIZE.