74 paNotInitialized = -10000,
75 paUnanticipatedHostError,
76 paInvalidChannelCount,
80 paSampleFormatNotSupported,
81 paBadIODeviceCombination,
90 paIncompatibleHostApiSpecificStreamInfo,
101 paIncompatibleStreamHostApi,
168 #define paNoDevice ((PaDeviceIndex)-1)
176 #define paUseHostApiSpecificDeviceSpecification ((PaDeviceIndex)-2)
331 int hostApiDeviceIndex );
431 #define paFloat32 ((PaSampleFormat) 0x00000001)
432 #define paInt32 ((PaSampleFormat) 0x00000002)
433 #define paInt24 ((PaSampleFormat) 0x00000004)
434 #define paInt16 ((PaSampleFormat) 0x00000008)
435 #define paInt8 ((PaSampleFormat) 0x00000010)
436 #define paUInt8 ((PaSampleFormat) 0x00000020)
437 #define paCustomFormat ((PaSampleFormat) 0x00010000)
439 #define paNonInterleaved ((PaSampleFormat) 0x80000000)
448 PaHostApiIndex hostApi;
450 int maxInputChannels;
451 int maxOutputChannels;
454 PaTime defaultLowInputLatency;
455 PaTime defaultLowOutputLatency;
457 PaTime defaultHighInputLatency;
458 PaTime defaultHighOutputLatency;
460 double defaultSampleRate;
529 #define paFormatIsSupported (0)
586 #define paFramesPerBufferUnspecified (0)
600 #define paNoFlag ((PaStreamFlags) 0)
605 #define paClipOff ((PaStreamFlags) 0x00000001)
610 #define paDitherOff ((PaStreamFlags) 0x00000002)
621 #define paNeverDropInput ((PaStreamFlags) 0x00000004)
629 #define paPrimeOutputBuffersUsingStreamCallback ((PaStreamFlags) 0x00000008)
634 #define paPlatformSpecificFlags ((PaStreamFlags)0xFFFF0000)
640 PaTime inputBufferAdcTime;
642 PaTime outputBufferDacTime;
661 #define paInputUnderflow ((PaStreamCallbackFlags) 0x00000001)
670 #define paInputOverflow ((PaStreamCallbackFlags) 0x00000002)
676 #define paOutputUnderflow ((PaStreamCallbackFlags) 0x00000004)
681 #define paOutputOverflow ((PaStreamCallbackFlags) 0x00000008)
687 #define paPrimingOutput ((PaStreamCallbackFlags) 0x00000010)
746 const void *input,
void *output,
747 unsigned long frameCount,
749 PaStreamCallbackFlags statusFlags,
811 unsigned long framesPerBuffer,
812 PaStreamFlags streamFlags,
848 int numInputChannels,
849 int numOutputChannels,
850 PaSampleFormat sampleFormat,
852 unsigned long framesPerBuffer,
1056 unsigned long frames );
1083 unsigned long frames );
PaError Pa_Initialize(void)
Library initialization function - call this before using PortAudio.
int structVersion
this is struct version 1
int PaHostApiIndex
The type used to enumerate to host APIs at runtime.
PaDeviceIndex Pa_GetDefaultInputDevice(void)
Retrieve the index of the default input device.
PaDeviceIndex Pa_GetDeviceCount(void)
Retrieve the number of available devices.
PaHostApiTypeId type
The well known unique identifier of this host API.
PaError Pa_StopStream(PaStream *stream)
Terminates audio processing.
void PaStream
A single PaStream can provide multiple channels of real-time streaming audio input and output to a cl...
A structure containing unchanging information about an open stream.
const PaStreamInfo * Pa_GetStreamInfo(PaStream *stream)
Retrieve a pointer to a PaStreamInfo structure containing information about the specified stream...
A structure providing information and capabilities of PortAudio devices.
long errorCode
the error code returned
PaError Pa_GetSampleSize(PaSampleFormat format)
Retrieve the size of a given sample format in bytes.
PaError Pa_OpenStream(PaStream **stream, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, double sampleRate, unsigned long framesPerBuffer, PaStreamFlags streamFlags, PaStreamCallback *streamCallback, void *userData)
Opens a stream for either input, output or both.
double sampleRate
The sample rate of the stream in Hertz (samples per second).
PaHostApiIndex Pa_GetDefaultHostApi(void)
Retrieve the index of the default host API.
const char * name
A textual description of the host API for display on user interfaces.
int PaStreamCallback(const void *input, void *output, unsigned long frameCount, const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData)
Functions of type PaStreamCallback are implemented by PortAudio clients.
A structure containing information about a particular host API.
const PaHostErrorInfo * Pa_GetLastHostErrorInfo(void)
Return information about the last host error encountered.
PaError Pa_IsFormatSupported(const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, double sampleRate)
Determine whether it would be possible to open a stream with the specified parameters.
void PaStreamFinishedCallback(void *userData)
Functions of type PaStreamFinishedCallback are implemented by PortAudio clients.
int PaDeviceIndex
The type used to refer to audio devices.
PaError Pa_SetStreamFinishedCallback(PaStream *stream, PaStreamFinishedCallback *streamFinishedCallback)
Register a stream finished callback function which will be called when the stream becomes inactive...
PaError Pa_StartStream(PaStream *stream)
Commences audio processing.
void * hostApiSpecificStreamInfo
An optional pointer to a host api specific data structure containing additional information for devic...
PaDeviceIndex defaultInputDevice
The default input device for this host API.
int deviceCount
The number of devices belonging to this host API.
PaDeviceIndex Pa_HostApiDeviceIndexToDeviceIndex(PaHostApiIndex hostApi, int hostApiDeviceIndex)
Convert a host-API-specific device index to standard PortAudio device index.
PaError Pa_IsStreamStopped(PaStream *stream)
Determine whether the stream is stopped.
PaTime inputLatency
The input latency of the stream in seconds.
PaSampleFormat sampleFormat
The sample format of the buffer provided to the stream callback, a_ReadStream() or Pa_WriteStream()...
const char * errorText
a textual description of the error if available, otherwise a zero-length string
unsigned long PaStreamFlags
Flags used to control the behavior of a stream.
int PaError
Error codes returned by PortAudio functions.
PaError Pa_IsStreamActive(PaStream *stream)
Determine whether the stream is active.
PaHostApiTypeId
Unchanging unique identifiers for each supported host API.
PaTime suggestedLatency
The desired latency in seconds.
int Pa_GetVersion(void)
Retrieve the release number of the currently running PortAudio build, eg 1900.
Parameters for one direction (input or output) of a stream.
unsigned long PaStreamCallbackFlags
Flag bit constants for the statusFlags to PaStreamCallback.
PaTime Pa_GetStreamTime(PaStream *stream)
Determine the current time for the stream according to the same clock used to generate buffer timesta...
PaError Pa_OpenDefaultStream(PaStream **stream, int numInputChannels, int numOutputChannels, PaSampleFormat sampleFormat, double sampleRate, unsigned long framesPerBuffer, PaStreamCallback *streamCallback, void *userData)
A simplified version of Pa_OpenStream() that opens the default input and/or output devices...
PaDeviceIndex defaultOutputDevice
The default output device for this host API.
int structVersion
this is struct version 1
PaError Pa_AbortStream(PaStream *stream)
Terminates audio processing immediately without waiting for pending buffers to complete.
Structure used to return information about a host error condition.
const PaHostApiInfo * Pa_GetHostApiInfo(PaHostApiIndex hostApi)
Retrieve a pointer to a structure containing information about a specific host Api.
unsigned long PaSampleFormat
A type used to specify one or more sample formats.
signed long Pa_GetStreamReadAvailable(PaStream *stream)
Retrieve the number of frames that can be read from the stream without waiting.
PaHostApiIndex Pa_GetHostApiCount(void)
Retrieve the number of available host APIs.
const PaDeviceInfo * Pa_GetDeviceInfo(PaDeviceIndex device)
Retrieve a pointer to a PaDeviceInfo structure containing information about the specified device...
PaDeviceIndex Pa_GetDefaultOutputDevice(void)
Retrieve the index of the default output device.
PaStreamCallbackResult
Allowable return values for the PaStreamCallback.
PaDeviceIndex device
A valid device index in the range 0 to (Pa_GetDeviceCount()-1) specifying the device to be used or th...
void Pa_Sleep(long msec)
Put the caller to sleep for at least 'msec' milliseconds.
PaError Pa_ReadStream(PaStream *stream, void *buffer, unsigned long frames)
Read samples from an input stream.
PaHostApiTypeId hostApiType
the host API which returned the error code
PaTime outputLatency
The output latency of the stream in seconds.
PaError Pa_WriteStream(PaStream *stream, const void *buffer, unsigned long frames)
Write samples to an output stream.
double PaTime
The type used to represent monotonic time in seconds that can be used for syncronisation.
const char * Pa_GetErrorText(PaError errorCode)
Translate the supplied PortAudio error code into a human readable message.
int channelCount
The number of channels of sound to be delivered to the stream callback or accessed by Pa_ReadStream()...
PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex(PaHostApiTypeId type)
Convert a static host API unique identifier, into a runtime host API index.
signed long Pa_GetStreamWriteAvailable(PaStream *stream)
Retrieve the number of frames that can be written to the stream without waiting.
PaError Pa_CloseStream(PaStream *stream)
Closes an audio stream.
PaError Pa_Terminate(void)
Library termination function - call this when finished using PortAudio.
const char * Pa_GetVersionText(void)
Retrieve a textual description of the current PortAudio build, eg "PortAudio V19-devel 13 October 200...
Timing information for the buffers passed to the stream callback.
double Pa_GetStreamCpuLoad(PaStream *stream)
Retrieve CPU usage information for the specified stream.