PortAudio 2.0
|
Record input into a file, then playback recorded data from file (Windows only at the moment) More...
#include <stdio.h>
#include <stdlib.h>
#include "portaudio.h"
#include "pa_ringbuffer.h"
#include "pa_util.h"
Data Structures | |
struct | paTestData |
Macros | |
#define | FILE_NAME "audio_data.raw" |
#define | SAMPLE_RATE (44100) |
#define | FRAMES_PER_BUFFER (512) |
#define | NUM_SECONDS (10) |
#define | NUM_CHANNELS (2) |
#define | NUM_WRITES_PER_BUFFER (4) |
#define | DITHER_FLAG (0) |
#define | PA_SAMPLE_TYPE paFloat32 |
#define | SAMPLE_SILENCE (0.0f) |
#define | PRINTF_S_FORMAT "%.8f" |
Typedefs | |
typedef int(* | ThreadFunctionType) (void *) |
Functions | |
int | main (void) |
Record input into a file, then playback recorded data from file (Windows only at the moment)
#define DITHER_FLAG (0) |
#define FILE_NAME "audio_data.raw" |
Referenced by main().
#define FRAMES_PER_BUFFER (512) |
Referenced by main().
#define NUM_CHANNELS (2) |
Referenced by main().
#define NUM_SECONDS (10) |
Referenced by main().
#define NUM_WRITES_PER_BUFFER (4) |
#define PRINTF_S_FORMAT "%.8f" |
#define SAMPLE_RATE (44100) |
Referenced by main().
#define SAMPLE_SILENCE (0.0f) |
typedef int(* ThreadFunctionType) (void *) |
int main | ( | void | ) |
References PaStreamParameters::channelCount, PaDeviceInfo::defaultLowInputLatency, PaDeviceInfo::defaultLowOutputLatency, PaStreamParameters::device, paTestData::file, FILE_NAME, paTestData::frameIndex, FRAMES_PER_BUFFER, PaStreamParameters::hostApiSpecificStreamInfo, NUM_CHANNELS, NUM_SECONDS, Pa_CloseStream(), Pa_GetDefaultInputDevice(), Pa_GetDefaultOutputDevice(), Pa_GetDeviceInfo(), Pa_GetErrorText(), Pa_Initialize(), Pa_IsStreamActive(), Pa_OpenStream(), PA_SAMPLE_TYPE, Pa_Sleep(), Pa_StartStream(), Pa_Terminate(), paClipOff, paNoDevice, paNoError, PaUtil_AllocateZeroInitializedMemory(), PaUtil_FreeMemory(), PaUtil_InitializeRingBuffer(), paTestData::ringBuffer, paTestData::ringBufferData, SAMPLE_RATE, PaStreamParameters::sampleFormat, and PaStreamParameters::suggestedLatency.