Go to the source code of this file.
Classes | |
struct | PaHostApiInfo |
struct | PaHostErrorInfo |
struct | PaDeviceInfo |
struct | PaStreamParameters |
struct | PaStreamCallbackTimeInfo |
struct | PaStreamInfo |
Defines | |
#define | paNoDevice ((PaDeviceIndex)-1) |
#define | paUseHostApiSpecificDeviceSpecification ((PaDeviceIndex)-2) |
#define | paFloat32 ((PaSampleFormat) 0x00000001) |
#define | paInt32 ((PaSampleFormat) 0x00000002) |
#define | paInt24 ((PaSampleFormat) 0x00000004) |
#define | paInt16 ((PaSampleFormat) 0x00000008) |
#define | paInt8 ((PaSampleFormat) 0x00000010) |
#define | paUInt8 ((PaSampleFormat) 0x00000020) |
#define | paCustomFormat ((PaSampleFormat) 0x00010000) |
#define | paNonInterleaved ((PaSampleFormat) 0x80000000) |
#define | paFormatIsSupported (0) |
#define | paFramesPerBufferUnspecified (0) |
#define | paNoFlag ((PaStreamFlags) 0) |
#define | paClipOff ((PaStreamFlags) 0x00000001) |
#define | paDitherOff ((PaStreamFlags) 0x00000002) |
#define | paNeverDropInput ((PaStreamFlags) 0x00000004) |
#define | paPrimeOutputBuffersUsingStreamCallback ((PaStreamFlags) 0x00000008) |
#define | paPlatformSpecificFlags ((PaStreamFlags)0xFFFF0000) |
#define | paInputUnderflow ((PaStreamCallbackFlags) 0x00000001) |
#define | paInputOverflow ((PaStreamCallbackFlags) 0x00000002) |
#define | paOutputUnderflow ((PaStreamCallbackFlags) 0x00000004) |
#define | paOutputOverflow ((PaStreamCallbackFlags) 0x00000008) |
#define | paPrimingOutput ((PaStreamCallbackFlags) 0x00000010) |
Typedefs | |
typedef int | PaError |
typedef enum PaErrorCode | PaErrorCode |
typedef int | PaDeviceIndex |
typedef int | PaHostApiIndex |
typedef enum PaHostApiTypeId | PaHostApiTypeId |
typedef PaHostApiInfo | PaHostApiInfo |
typedef PaHostErrorInfo | PaHostErrorInfo |
typedef double | PaTime |
typedef unsigned long | PaSampleFormat |
typedef PaDeviceInfo | PaDeviceInfo |
typedef PaStreamParameters | PaStreamParameters |
typedef void | PaStream |
typedef unsigned long | PaStreamFlags |
typedef PaStreamCallbackTimeInfo | PaStreamCallbackTimeInfo |
typedef unsigned long | PaStreamCallbackFlags |
typedef enum PaStreamCallbackResult | PaStreamCallbackResult |
typedef int | PaStreamCallback (const void *input, void *output, unsigned long frameCount, const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData) |
typedef void | PaStreamFinishedCallback (void *userData) |
typedef PaStreamInfo | PaStreamInfo |
Enumerations | |
enum | PaErrorCode { paNoError = 0, paNotInitialized = -10000, paUnanticipatedHostError, paInvalidChannelCount, paInvalidSampleRate, paInvalidDevice, paInvalidFlag, paSampleFormatNotSupported, paBadIODeviceCombination, paInsufficientMemory, paBufferTooBig, paBufferTooSmall, paNullCallback, paBadStreamPtr, paTimedOut, paInternalError, paDeviceUnavailable, paIncompatibleHostApiSpecificStreamInfo, paStreamIsStopped, paStreamIsNotStopped, paInputOverflowed, paOutputUnderflowed, paHostApiNotFound, paInvalidHostApi, paCanNotReadFromACallbackStream, paCanNotWriteToACallbackStream, paCanNotReadFromAnOutputOnlyStream, paCanNotWriteToAnInputOnlyStream, paIncompatibleStreamHostApi, paBadBufferPtr } |
enum | PaHostApiTypeId { paInDevelopment = 0, paDirectSound = 1, paMME = 2, paASIO = 3, paSoundManager = 4, paCoreAudio = 5, paOSS = 7, paALSA = 8, paAL = 9, paBeOS = 10, paWDMKS = 11, paJACK = 12, paWASAPI = 13 } |
enum | PaStreamCallbackResult { paContinue = 0, paComplete = 1, paAbort = 2 } |
Functions | |
int | Pa_GetVersion (void) |
const char * | Pa_GetVersionText (void) |
const char * | Pa_GetErrorText (PaError errorCode) |
PaError | Pa_Initialize (void) |
PaError | Pa_Terminate (void) |
PaHostApiIndex | Pa_GetHostApiCount (void) |
PaHostApiIndex | Pa_GetDefaultHostApi (void) |
const PaHostApiInfo * | Pa_GetHostApiInfo (PaHostApiIndex hostApi) |
PaHostApiIndex | Pa_HostApiTypeIdToHostApiIndex (PaHostApiTypeId type) |
PaDeviceIndex | Pa_HostApiDeviceIndexToDeviceIndex (PaHostApiIndex hostApi, int hostApiDeviceIndex) |
const PaHostErrorInfo * | Pa_GetLastHostErrorInfo (void) |
PaDeviceIndex | Pa_GetDeviceCount (void) |
PaDeviceIndex | Pa_GetDefaultInputDevice (void) |
PaDeviceIndex | Pa_GetDefaultOutputDevice (void) |
const PaDeviceInfo * | Pa_GetDeviceInfo (PaDeviceIndex device) |
PaError | Pa_IsFormatSupported (const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, double sampleRate) |
PaError | Pa_OpenStream (PaStream **stream, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, double sampleRate, unsigned long framesPerBuffer, PaStreamFlags streamFlags, PaStreamCallback *streamCallback, void *userData) |
PaError | Pa_OpenDefaultStream (PaStream **stream, int numInputChannels, int numOutputChannels, PaSampleFormat sampleFormat, double sampleRate, unsigned long framesPerBuffer, PaStreamCallback *streamCallback, void *userData) |
PaError | Pa_CloseStream (PaStream *stream) |
PaError | Pa_SetStreamFinishedCallback (PaStream *stream, PaStreamFinishedCallback *streamFinishedCallback) |
PaError | Pa_StartStream (PaStream *stream) |
PaError | Pa_StopStream (PaStream *stream) |
PaError | Pa_AbortStream (PaStream *stream) |
PaError | Pa_IsStreamStopped (PaStream *stream) |
PaError | Pa_IsStreamActive (PaStream *stream) |
const PaStreamInfo * | Pa_GetStreamInfo (PaStream *stream) |
PaTime | Pa_GetStreamTime (PaStream *stream) |
double | Pa_GetStreamCpuLoad (PaStream *stream) |
PaError | Pa_ReadStream (PaStream *stream, void *buffer, unsigned long frames) |
PaError | Pa_WriteStream (PaStream *stream, const void *buffer, unsigned long frames) |
signed long | Pa_GetStreamReadAvailable (PaStream *stream) |
signed long | Pa_GetStreamWriteAvailable (PaStream *stream) |
PaError | Pa_GetSampleSize (PaSampleFormat format) |
void | Pa_Sleep (long msec) |
Definition in file portaudio.h.
|
Disable default clipping of out of range samples.
Definition at line 598 of file portaudio.h. |
|
Definition at line 430 of file portaudio.h. |
|
Disable default dithering.
Definition at line 603 of file portaudio.h. |
|
Definition at line 424 of file portaudio.h. Referenced by Jack::JackPortAudioDriver::Open(), and Jack::JackPortAudioDriver::SetBufferSize(). |
|
Return code for Pa_IsFormatSupported indicating success. Definition at line 522 of file portaudio.h. |
|
Can be passed as the framesPerBuffer parameter to Pa_OpenStream() or Pa_OpenDefaultStream() to indicate that the stream callback will accept buffers of any size. Definition at line 579 of file portaudio.h. |
|
In a stream opened with paFramesPerBufferUnspecified, indicates that data prior to the first sample of the input buffer was discarded due to an overflow, possibly because the stream callback is using too much CPU time. Otherwise indicates that data prior to one or more samples in the input buffer was discarded.
Definition at line 664 of file portaudio.h. |
|
In a stream opened with paFramesPerBufferUnspecified, indicates that input data is all silence (zeros) because no real data is available. In a stream opened without paFramesPerBufferUnspecified, it indicates that one or more zero samples have been inserted into the input buffer to compensate for an input underflow.
Definition at line 655 of file portaudio.h. |
|
Definition at line 427 of file portaudio.h. |
|
Packed 24 bit format.
Definition at line 426 of file portaudio.h. |
|
Definition at line 425 of file portaudio.h. |
|
Definition at line 428 of file portaudio.h. |
|
Flag requests that where possible a full duplex stream will not discard overflowed input samples without calling the stream callback. This flag is only valid for full duplex callback streams and only when used in combination with the paFramesPerBufferUnspecified (0) framesPerBuffer parameter. Using this flag incorrectly results in a paInvalidFlag error being returned from Pa_OpenStream and Pa_OpenDefaultStream.
Definition at line 614 of file portaudio.h. |
|
A special PaDeviceIndex value indicating that no device is available, or should be used.
Definition at line 161 of file portaudio.h. Referenced by Jack::JackPortAudioDriver::Open(), and Jack::JackPortAudioDriver::SetBufferSize(). |
|
Definition at line 593 of file portaudio.h. Referenced by Jack::JackPortAudioDriver::Open(), and Jack::JackPortAudioDriver::SetBufferSize(). |
|
Indicates that output data will be discarded because no room is available.
Definition at line 675 of file portaudio.h. |
|
Indicates that output data (or a gap) was inserted, possibly because the stream callback is using too much CPU time.
Definition at line 670 of file portaudio.h. |
|
A mask specifying the platform specific bits.
Definition at line 627 of file portaudio.h. |
|
Call the stream callback to fill initial output buffers, rather than the default behavior of priming the buffers with zeros (silence). This flag has no effect for input-only and blocking read/write streams.
Definition at line 622 of file portaudio.h. |
|
Some of all of the output data will be used to prime the stream, input data may be zero.
Definition at line 681 of file portaudio.h. |
|
Definition at line 429 of file portaudio.h. |
|
A special PaDeviceIndex value indicating that the device(s) to be used are specified in the host api specific stream info structure.
Definition at line 169 of file portaudio.h. |
|
The type used to refer to audio devices. Values of this type usually range from 0 to (Pa_DeviceCount-1), and may also take on the PaNoDevice and paUseHostApiSpecificDeviceSpecification values.
Definition at line 153 of file portaudio.h. |
|
A structure providing information and capabilities of PortAudio devices. Devices may support input, output or both input and output. |
|
Error codes returned by PortAudio functions. Note that with the exception of paNoError, all PaErrorCodes are negative. Definition at line 63 of file portaudio.h. |
|
The type used to enumerate to host APIs at runtime. Values of this type range from 0 to (Pa_GetHostApiCount()-1).
Definition at line 179 of file portaudio.h. |
|
A structure containing information about a particular host API. |
|
Unchanging unique identifiers for each supported host API. This type is used in the PaHostApiInfo structure. The values are guaranteed to be unique and to never change, thus allowing code to be written that conditionally uses host API specific extensions. New type ids will be allocated when support for a host API reaches "public alpha" status, prior to that developers should use the paInDevelopment type id.
|
|
Structure used to return information about a host error condition. |
|
A type used to specify one or more sample formats. Each value indicates a possible format for sound data passed to and from the stream callback, Pa_ReadStream and Pa_WriteStream. The standard formats paFloat32, paInt16, paInt32, paInt24, paInt8 and aUInt8 are usually implemented by all implementations. The floating point representation (paFloat32) uses +1.0 and -1.0 as the maximum and minimum respectively. paUInt8 is an unsigned 8 bit format where 128 is considered "ground" The paNonInterleaved flag indicates that a multichannel buffer is passed as a set of non-interleaved pointers.
Definition at line 421 of file portaudio.h. |
|
A single PaStream can provide multiple channels of real-time streaming audio input and output to a client application. A stream provides access to audio hardware represented by one or more PaDevices. Depending on the underlying Host API, it may be possible to open multiple streams using the same device, however this behavior is implementation defined. Portable applications should assume that a PaDevice may be simultaneously used by at most one PaStream. Pointers to PaStream objects are passed between PortAudio functions that operate on streams.
Definition at line 572 of file portaudio.h. |
|
Functions of type PaStreamCallback are implemented by PortAudio clients. They consume, process or generate audio in response to requests from an active PortAudio stream.
Definition at line 739 of file portaudio.h. |
|
Flag bit constants for the statusFlags to PaStreamCallback.
Definition at line 646 of file portaudio.h. |
|
Allowable return values for the PaStreamCallback.
|
|
Timing information for the buffers passed to the stream callback. |
|
Functions of type PaStreamFinishedCallback are implemented by PortAudio clients. They can be registered with a stream using the Pa_SetStreamFinishedCallback function. Once registered they are called when the stream becomes inactive (ie once a call to Pa_StopStream() will not block). A stream will become inactive after the stream callback returns non-zero, or when Pa_StopStream or Pa_AbortStream is called. For a stream providing audio output, if the stream callback returns paComplete, or Pa_StopStream is called, the stream finished callback will not be called until all generated sample data has been played.
Definition at line 871 of file portaudio.h. |
|
Flags used to control the behavior of a stream. They are passed as parameters to Pa_OpenStream or Pa_OpenDefaultStream. Multiple flags may be ORed together.
Definition at line 590 of file portaudio.h. |
|
A structure containing unchanging information about an open stream.
|
|
Parameters for one direction (input or output) of a stream. |
|
The type used to represent monotonic time in seconds that can be used for syncronisation. The type is used for the outTime argument to the PaStreamCallback and as the result of Pa_GetStreamTime().
Definition at line 399 of file portaudio.h. |
|
Definition at line 64 of file portaudio.h. |
|
Unchanging unique identifiers for each supported host API. This type is used in the PaHostApiInfo structure. The values are guaranteed to be unique and to never change, thus allowing code to be written that conditionally uses host API specific extensions. New type ids will be allocated when support for a host API reaches "public alpha" status, prior to that developers should use the paInDevelopment type id.
Definition at line 216 of file portaudio.h. |
|
Allowable return values for the PaStreamCallback.
Definition at line 687 of file portaudio.h. |
|
Terminates audio processing immediately without waiting for pending buffers to complete. |
|
Closes an audio stream. If the audio stream is active it discards any pending buffers as if Pa_AbortStream() had been called. Referenced by Jack::JackPortAudioDriver::Close(), and Jack::JackPortAudioDriver::SetBufferSize(). |
|
Retrieve the index of the default host API. The default host API will be the lowest common denominator host API on the current platform and is unlikely to provide the best performance.
|
|
Retrieve the index of the default input device. The result can be used in the inputDevice parameter to Pa_OpenStream().
Referenced by Jack::JackPortAudioDriver::Open(). |
|
Retrieve the index of the default output device. The result can be used in the outputDevice parameter to Pa_OpenStream().
Referenced by Jack::JackPortAudioDriver::Open(). |
|
Retrieve the number of available devices. The number of available devices may be zero.
|
|
Retrieve a pointer to a PaDeviceInfo structure containing information about the specified device.
Referenced by Jack::JackPortAudioDriver::Open(), and Jack::JackPortAudioDriver::SetBufferSize(). |
|
Translate the supplied PortAudio error code into a human readable message. Referenced by Jack::JackPortAudioDriver::Open(), and Jack::JackPortAudioDriver::SetBufferSize(). |
|
Retrieve the number of available host APIs. Even if a host API is available it may have no devices available.
|
|
Retrieve a pointer to a structure containing information about a specific host Api.
|
|
Return information about the last host error encountered. The error information returned by Pa_GetLastHostErrorInfo() will never be modified asyncronously by errors occurring in other PortAudio owned threads (such as the thread that manages the stream callback.) This function is provided as a last resort, primarily to enhance debugging by providing clients with access to all available error information.
|
|
Retrieve the size of a given sample format in bytes.
|
|
Retrieve CPU usage information for the specified stream. The "CPU Load" is a fraction of total CPU time consumed by a callback stream's audio processing routines including, but not limited to the client supplied stream callback. This function does not work with blocking read/write streams. This function may be called from the stream callback function or the application.
|
|
Retrieve a pointer to a PaStreamInfo structure containing information about the specified stream.
|
|
Retrieve the number of frames that can be read from the stream without waiting.
|
|
Determine the current time for the stream according to the same clock used to generate buffer timestamps. This time may be used for syncronising other events to the audio stream, for example synchronizing audio to MIDI.
|
|
Retrieve the number of frames that can be written to the stream without waiting.
|
|
Retrieve the release number of the currently running PortAudio build, eg 1900. |
|
Retrieve a textual description of the current PortAudio build, eg "PortAudio V19-devel 13 October 2002". |
|
Convert a host-API-specific device index to standard PortAudio device index. This function may be used in conjunction with the deviceCount field of PaHostApiInfo to enumerate all devices for the specified host API.
A paInvalidDevice error code indicates that the hostApiDeviceIndex parameter is out of range.
|
|
Convert a static host API unique identifier, into a runtime host API index.
|
|
Library initialization function - call this before using PortAudio. This function initialises internal data structures and prepares underlying host APIs for use. This function MUST be called before using any other PortAudio API functions. If Pa_Initialize() is called multiple times, each successful call must be matched with a corresponding call to Pa_Terminate(). Pairs of calls to Pa_Initialize()/Pa_Terminate() may overlap, and are not required to be fully nested. Note that if Pa_Initialize() returns an error code, Pa_Terminate() should NOT be called.
Referenced by Jack::JackPortAudioDriver::Open(). |
|
Determine whether it would be possible to open a stream with the specified parameters.
|
|
Determine whether the stream is active. A stream is active after a successful call to Pa_StartStream(), until it becomes inactive either as a result of a call to Pa_StopStream() or Pa_AbortStream(), or as a result of a return value other than paContinue from the stream callback. In the latter case, the stream is considered inactive after the last buffer has finished playing.
|
|
Determine whether the stream is stopped. A stream is considered to be stopped prior to a successful call to Pa_StartStream and after a successful call to Pa_StopStream or Pa_AbortStream. If a stream callback returns a value other than paContinue the stream is NOT considered to be stopped.
|
|
A simplified version of Pa_OpenStream() that opens the default input and/or output devices.
|
|
Opens a stream for either input, output or both.
Referenced by Jack::JackPortAudioDriver::Open(), and Jack::JackPortAudioDriver::SetBufferSize(). |
|
Read samples from an input stream. The function doesn't return until the entire buffer has been filled - this may involve waiting for the operating system to supply the data.
|
|
Register a stream finished callback function which will be called when the stream becomes inactive. See the description of PaStreamFinishedCallback for further details about when the callback will be called.
|
|
Put the caller to sleep for at least 'msec' milliseconds. This function is provided only as a convenience for authors of portable code (such as the tests and examples in the PortAudio distribution.) The function may sleep longer than requested so don't rely on this for accurate musical timing. |
|
Commences audio processing. Referenced by Jack::JackPortAudioDriver::Start(). |
|
Terminates audio processing. It waits until all pending audio buffers have been played before it returns. Referenced by Jack::JackPortAudioDriver::Stop(). |
|
Library termination function - call this when finished using PortAudio. This function deallocates all resources allocated by PortAudio since it was initializied by a call to Pa_Initialize(). In cases where Pa_Initialise() has been called multiple times, each call must be matched with a corresponding call to Pa_Terminate(). The final matching call to Pa_Terminate() will automatically close any PortAudio streams that are still open. Pa_Terminate() MUST be called before exiting a program which uses PortAudio. Failure to do so may result in serious resource leaks, such as audio devices not being available until the next reboot.
Referenced by Jack::JackPortAudioDriver::Close(), and Jack::JackPortAudioDriver::Open(). |
|
Write samples to an output stream. This function doesn't return until the entire buffer has been consumed - this may involve waiting for the operating system to consume the data.
|