Crate weresocool_portaudio_sys

Crate weresocool_portaudio_sys 

Source

Structs§

PaDeviceInfo
A structure providing information and capabilities of PortAudio devices. Devices may support input, output or both input and output.
PaHostApiInfo
A structure containing information about a particular host API.
PaHostErrorInfo
Structure used to return information about a host error condition.
PaStreamCallbackTimeInfo
Timing information for the buffers passed to the stream callback.
PaStreamInfo
A structure containing unchanging information about an open stream. see Pa_GetStreamInfo
PaStreamParameters
Parameters for one direction (input or output) of a stream.
PaVersionInfo
A structure containing PortAudio API version information. see Pa_GetVersionInfo, paMakeVersionNumber version Available as of 19.5.0.

Constants§

INPUT_OVERFLOW
INPUT_UNDERFLOW
OUTPUT_OVERFLOW
OUTPUT_UNDERFLOW
PA_ABORT
PA_CLIP_OFF
PA_COMPLETE
PA_CONTINUE
PA_CUSTOM_FORMAT
PA_DITHER_OFF
PA_FLOAT_32
PA_INT_8
PA_INT_16
PA_INT_24
PA_INT_32
PA_NEVER_DROP_INPUT
PA_NON_INTERLEAVED
PA_NO_DEVICE
PA_NO_FLAG
PA_PLATFORM_SPECIFIC_FLAGS
PA_PRIME_OUTPUT_BUFFERS_USING_STREAM_CALLBACK
PA_UINT_8
PRIMING_OUTPUT
PaErrorCode_paBadBufferPtr
PaErrorCode_paBadIODeviceCombination
PaErrorCode_paBadStreamPtr
PaErrorCode_paBufferTooBig
PaErrorCode_paBufferTooSmall
PaErrorCode_paCanNotReadFromACallbackStream
PaErrorCode_paCanNotReadFromAnOutputOnlyStream
PaErrorCode_paCanNotWriteToACallbackStream
PaErrorCode_paCanNotWriteToAnInputOnlyStream
PaErrorCode_paDeviceUnavailable
PaErrorCode_paHostApiNotFound
PaErrorCode_paIncompatibleHostApiSpecificStreamInfo
PaErrorCode_paIncompatibleStreamHostApi
PaErrorCode_paInputOverflowed
PaErrorCode_paInsufficientMemory
PaErrorCode_paInternalError
PaErrorCode_paInvalidChannelCount
PaErrorCode_paInvalidDevice
PaErrorCode_paInvalidFlag
PaErrorCode_paInvalidHostApi
PaErrorCode_paInvalidSampleRate
PaErrorCode_paNoError
PaErrorCode_paNotInitialized
PaErrorCode_paNullCallback
PaErrorCode_paOutputUnderflowed
PaErrorCode_paSampleFormatNotSupported
PaErrorCode_paStreamIsNotStopped
PaErrorCode_paStreamIsStopped
PaErrorCode_paTimedOut
PaErrorCode_paUnanticipatedHostError
PaHostApiTypeId_paAL
PaHostApiTypeId_paALSA
PaHostApiTypeId_paASIO
PaHostApiTypeId_paAudioScienceHPI
PaHostApiTypeId_paBeOS
PaHostApiTypeId_paCoreAudio
PaHostApiTypeId_paDirectSound
PaHostApiTypeId_paInDevelopment
PaHostApiTypeId_paJACK
PaHostApiTypeId_paMME
PaHostApiTypeId_paOSS
PaHostApiTypeId_paSoundManager
PaHostApiTypeId_paWASAPI
PaHostApiTypeId_paWDMKS
paFormatIsSupported
paFramesPerBufferUnspecified

Functions§

Pa_AbortStream
Terminates audio processing immediately without waiting for pending buffers to complete.
Pa_CloseStream
Closes an audio stream. If the audio stream is active it discards any pending buffers as if Pa_AbortStream() had been called.
Pa_GetDefaultHostApi
Retrieve the index of the default host API. The default host API will be
Pa_GetDefaultInputDevice
Retrieve the index of the default input device. The result can be used in the inputDevice parameter to Pa_OpenStream().
Pa_GetDefaultOutputDevice
Retrieve the index of the default output device. The result can be used in the outputDevice parameter to Pa_OpenStream().
Pa_GetDeviceCount
Retrieve the number of available devices. The number of available devices may be zero.
Pa_GetDeviceInfo
Retrieve a pointer to a PaDeviceInfo structure containing information about the specified device. return A pointer to an immutable PaDeviceInfo structure. If the device parameter is out of range the function returns NULL.
Pa_GetErrorText
Translate the supplied PortAudio error code into a human readable message.
Pa_GetHostApiCount
Retrieve the number of available host APIs. Even if a host API is available it may have no devices available. return A non-negative value indicating the number of available host APIs or, a PaErrorCode (which are always negative) if PortAudio is not initialized or an error is encountered. see PaHostApiIndex
Pa_GetHostApiInfo
Retrieve a pointer to a structure containing information about a specific host Api.
Pa_GetLastHostErrorInfo
Return information about the last host error encountered. The error information returned by Pa_GetLastHostErrorInfo() will never be modified asynchronously by errors occurring in other PortAudio owned threads (such as the thread that manages the stream callback.)
Pa_GetSampleSize
Retrieve the size of a given sample format in bytes. return The size in bytes of a single sample in the specified format, or paSampleFormatNotSupported if the format is not supported.
Pa_GetStreamCpuLoad
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. returns a floating point value, typically between 0.0 and 1.0, where 1.0 indicates that the stream callback is consuming the maximum number of CPU cycles possible to maintain real-time operation. A value of 0.5 would imply that PortAudio and the stream callback was consuming roughly 50% of the available CPU time. The return value may exceed 1.0. A value of 0.0 will always be returned for a blocking read/write stream, or if an error occurs.
Pa_GetStreamInfo
Retrieve a pointer to a PaStreamInfo structure containing information about the specified stream. return A pointer to an immutable PaStreamInfo structure. If the stream parameter is invalid, or an error is encountered, the function returns NULL. param stream A pointer to an open stream previously created with Pa_OpenStream. note PortAudio manages the memory referenced by the returned pointer, the client must not manipulate or free the memory. The pointer is only guaranteed to be valid until the specified stream is closed. see PaStreamInfo
Pa_GetStreamReadAvailable
Retrieve the number of frames that can be read from the stream without waiting. return Returns a non-negative value representing the maximum number of frames that can be read from the stream without blocking or busy waiting or, a PaErrorCode (which are always negative) if PortAudio is not initialized or an error is encountered.
Pa_GetStreamTime
Returns the current time in seconds for a stream according to the same clock used to generate callback PaStreamCallbackTimeInfo timestamps. The time values are monotonically increasing and have unspecified origin. Pa_GetStreamTime returns valid time values for the entire life of the stream, from when the stream is opened until it is closed. Starting and stopping the stream does not affect the passage of time returned by Pa_GetStreamTime. This time may be used for synchronizing other events to the audio stream, for example synchronizing audio to MIDI. return The stream’s current time in seconds, or 0 if an error occurred. see PaTime, PaStreamCallback, PaStreamCallbackTimeInfo
Pa_GetStreamWriteAvailable
Retrieve the number of frames that can be written to the stream without waiting. return Returns a non-negative value representing the maximum number of frames that can be written to the stream without blocking or busy waiting or, a PaErrorCode (which are always negative) if PortAudio is not initialized or an error is encountered.
Pa_GetVersion
Retrieve the release number of the currently running PortAudio build. For example, for version “19.5.1” this will return 0x00130501. see paMakeVersionNumber
Pa_GetVersionInfo
Retrieve version information for the currently running PortAudio build. return A pointer to an immutable PaVersionInfo structure. note This function can be called at any time. It does not require PortAudio to be initialized. The structure pointed to is statically allocated. Do not attempt to free it or modify it. see PaVersionInfo, paMakeVersionNumber version Available as of 19.5.0.
Pa_GetVersionText
Retrieve a textual description of the current PortAudio build, e.g. “PortAudio V19.5.0-devel, revision 1952M”. The format of the text may change in the future. Do not try to parse the returned string. deprecated As of 19.5.0, use Pa_GetVersionInfo()->versionText instead.
Pa_HostApiDeviceIndexToDeviceIndex
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.
Pa_HostApiTypeIdToHostApiIndex
Convert a static host API unique identifier, into a runtime host API index.
Pa_Initialize
Library initialization function - call this before using PortAudio. This function initializes internal data structures and prepares underlying host APIs for use. With the exception of Pa_GetVersion(), Pa_GetVersionText(), and Pa_GetErrorText(), 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. return paNoError if successful, otherwise an error code indicating the cause of failure. see Pa_Terminate
Pa_IsFormatSupported
Determine whether it would be possible to open a stream with the specified
Pa_IsStreamActive
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. Returns one (1) when the stream is active (ie playing or recording audio), zero (0) when not playing or, a PaErrorCode (which are always negative) if PortAudio is not initialized or an error is encountered. see Pa_StopStream, Pa_AbortStream, Pa_IsStreamStopped
Pa_IsStreamStopped
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. Returns one (1) when the stream is stopped, zero (0) when the stream is running or, a PaErrorCode (which are always negative) if PortAudio is not initialized or an error is encountered. see Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive
Pa_OpenDefaultStream
A simplified version of Pa_OpenStream() that opens the default input and/or output devices.
Pa_OpenStream
Opens a stream for either input, output or both.
Pa_ReadStream
Pa_SetStreamFinishedCallback
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. param stream a pointer to a PaStream that is in the stopped state - if the stream is not stopped, the stream’s finished callback will remain unchanged and an error code will be returned. param streamFinishedCallback a pointer to a function with the same signature as PaStreamFinishedCallback, that will be called when the stream becomes inactive. Passing NULL for this parameter will un-register a previously registered stream finished callback function. return on success returns paNoError, otherwise an error code indicating the cause of the error. see PaStreamFinishedCallback
Pa_Sleep
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.
Pa_StartStream
Commences audio processing.
Pa_StopStream
Terminates audio processing. It waits until all pending audio buffers have been played before it returns.
Pa_Terminate
Library termination function - call this when finished using PortAudio. This function deallocates all resources allocated by PortAudio since it was initialized 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. return paNoError if successful, otherwise an error code indicating the cause of failure. see Pa_Initialize
Pa_WriteStream
Write samples to an output stream. This function doesn’t return until the entire buffer has been written - this may involve waiting for the operating system to consume the data. param stream A pointer to an open stream previously created with Pa_OpenStream. param buffer A pointer to a buffer of sample frames. The buffer contains samples in the format specified by the outputParameters->sampleFormat field used to open the stream, and the number of channels specified by outputParameters->numChannels. If non-interleaved samples were requested using the paNonInterleaved sample format flag, buffer is a pointer to the first element of an array of buffer pointers, one non-interleaved buffer for each channel. param frames The number of frames to be written from buffer. This parameter is not constrained to a specific range, however high performance applications will want to match this parameter to the framesPerBuffer parameter used when opening the stream. return On success PaNoError will be returned, or paOutputUnderflowed if additional output data was inserted after the previous call and before this call.
c_str_to_str
Safety
str_to_c_str
A function to convert Rust strings to C strings

Type Aliases§

PaDeviceIndex
The type used to refer to audio devices. Values of this type usually range from 0 to (Pa_GetDeviceCount()-1), and may also take on the PaNoDevice and paUseHostApiSpecificDeviceSpecification values.
PaError
Error codes returned by PortAudio functions. Note that with the exception of paNoError, all PaErrorCodes are negative.
PaErrorCode
PaHostApiIndex
The type used to enumerate to host APIs at runtime. Values of this type range from 0 to (Pa_GetHostApiCount()-1). see Pa_GetHostApiCount
PaHostApiTypeId
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.
PaSampleFormat
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.
PaStream
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.
PaStreamCallback
Functions of type PaStreamCallback are implemented by PortAudio clients. They consume, process or generate audio in response to requests from an active PortAudio stream.
PaStreamCallbackFlags
Flag bit constants for the statusFlags to PaStreamCallback.
PaStreamCallbackResult
Allowable return values for the PaStreamCallback. @see PaStreamCallback
PaStreamFinishedCallback
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. param userData The userData parameter supplied to Pa_OpenStream() see Pa_SetStreamFinishedCallback
PaStreamFlags
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.
PaTime
The type used to represent monotonic time in seconds. PaTime is used for the fields of the PaStreamCallbackTimeInfo argument to the PaStreamCallback and as the result of Pa_GetStreamTime().
SampleFormat
StreamCallbackFlags
StreamFlags