📄 pa_process.h
字号:
unsigned long frameCount );/** Use for the second buffer half when the input buffer is split in two halves. @see PaUtil_SetInputChannel*/void PaUtil_Set2ndInputChannel( PaUtilBufferProcessor* bufferProcessor, unsigned int channel, void *data, unsigned int stride );/** Use for the second buffer half when the input buffer is split in two halves. @see PaUtil_SetInterleavedInputChannels*/void PaUtil_Set2ndInterleavedInputChannels( PaUtilBufferProcessor* bufferProcessor, unsigned int firstChannel, void *data, unsigned int channelCount );/** Use for the second buffer half when the input buffer is split in two halves. @see PaUtil_SetNonInterleavedInputChannel*/void PaUtil_Set2ndNonInterleavedInputChannel( PaUtilBufferProcessor* bufferProcessor, unsigned int channel, void *data ); /** Set the number of frames in the output host buffer(s) specified by the PaUtil_Set*OutputChannel functions. @param bufferProcessor The buffer processor. @param frameCount The number of host output frames. A 0 frameCount indicates to use the framesPerHostBuffer value passed to PaUtil_InitializeBufferProcessor. @see PaUtil_SetOutputChannel, PaUtil_SetInterleavedOutputChannels, PaUtil_SetNonInterleavedOutputChannel*/void PaUtil_SetOutputFrameCount( PaUtilBufferProcessor* bufferProcessor, unsigned long frameCount );/** Indicate that the output will be discarded. This function should be used when implementing the paNeverDropInput mode for full duplex streams. @param bufferProcessor The buffer processor.*/void PaUtil_SetNoOutput( PaUtilBufferProcessor* bufferProcessor );/** Provide the buffer processor with a pointer to a host output channel. @param bufferProcessor The buffer processor. @param channel The channel number. @param data The buffer. @param stride The stride from one sample to the next, in samples. For interleaved host buffers, the stride will usually be the same as the number of channels in the buffer.*/void PaUtil_SetOutputChannel( PaUtilBufferProcessor* bufferProcessor, unsigned int channel, void *data, unsigned int stride );/** Provide the buffer processor with a pointer to a number of interleaved host output channels. @param bufferProcessor The buffer processor. @param firstChannel The first channel number. @param data The buffer. @param channelCount The number of interleaved channels in the buffer. If channelCount is zero, the number of channels specified to PaUtil_InitializeBufferProcessor will be used.*/void PaUtil_SetInterleavedOutputChannels( PaUtilBufferProcessor* bufferProcessor, unsigned int firstChannel, void *data, unsigned int channelCount ); /** Provide the buffer processor with a pointer to one non-interleaved host output channel. @param bufferProcessor The buffer processor. @param channel The channel number. @param data The buffer.*/void PaUtil_SetNonInterleavedOutputChannel( PaUtilBufferProcessor* bufferProcessor, unsigned int channel, void *data );/** Use for the second buffer half when the output buffer is split in two halves. @see PaUtil_SetOutputFrameCount*/void PaUtil_Set2ndOutputFrameCount( PaUtilBufferProcessor* bufferProcessor, unsigned long frameCount );/** Use for the second buffer half when the output buffer is split in two halves. @see PaUtil_SetOutputChannel*/void PaUtil_Set2ndOutputChannel( PaUtilBufferProcessor* bufferProcessor, unsigned int channel, void *data, unsigned int stride );/** Use for the second buffer half when the output buffer is split in two halves. @see PaUtil_SetInterleavedOutputChannels*/void PaUtil_Set2ndInterleavedOutputChannels( PaUtilBufferProcessor* bufferProcessor, unsigned int firstChannel, void *data, unsigned int channelCount );/** Use for the second buffer half when the output buffer is split in two halves. @see PaUtil_SetNonInterleavedOutputChannel*/void PaUtil_Set2ndNonInterleavedOutputChannel( PaUtilBufferProcessor* bufferProcessor, unsigned int channel, void *data );/*@}*//** @name Buffer processing functions for callback streams*//*@{*//** Commence processing a host buffer (or a pair of host buffers in the full-duplex case) for a callback stream. @param bufferProcessor The buffer processor. @param timeInfo Timing information for the first sample of the host buffer(s). This information may be adjusted when buffer adaption is being performed. @param callbackStatusFlags Flags indicating whether underruns and overruns have occurred since the last time the buffer processor was called.*/void PaUtil_BeginBufferProcessing( PaUtilBufferProcessor* bufferProcessor, PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags callbackStatusFlags ); /** Finish processing a host buffer (or a pair of host buffers in the full-duplex case) for a callback stream. @param bufferProcessor The buffer processor. @param callbackResult On input, indicates a previous callback result, and on exit, the result of the user stream callback, if it is called. On entry callbackResult should contain one of { paContinue, paComplete, or paAbort}. If paComplete is passed, the stream callback will not be called but any audio that was generated by previous stream callbacks will be copied to the output buffer(s). You can check whether the buffer processor's internal buffer is empty by calling PaUtil_IsBufferProcessorOutputEmpty. If the stream callback is called its result is stored in *callbackResult. If the stream callback returns paComplete or paAbort, all output buffers will be full of valid data - some of which may be zeros to acount for data that wasn't generated by the terminating callback. @return The number of frames processed. This usually corresponds to the number of frames specified by the PaUtil_Set*FrameCount functions, exept in the paUtilVariableHostBufferSizePartialUsageAllowed buffer size mode when a smaller value may be returned.*/unsigned long PaUtil_EndBufferProcessing( PaUtilBufferProcessor* bufferProcessor, int *callbackResult );/** Determine whether any callback generated output remains in the bufffer processor's internal buffers. This method may be used to determine when to continue calling PaUtil_EndBufferProcessing() after the callback has returned a callbackResult of paComplete. @param bufferProcessor The buffer processor. @return Returns non-zero when callback generated output remains in the internal buffer and zero (0) when there internal buffer contains no callback generated data.*/int PaUtil_IsBufferProcessorOutputEmpty( PaUtilBufferProcessor* bufferProcessor );/*@}*//** @name Buffer processing functions for blocking read/write streams*//*@{*//** Copy samples from host input channels set up by the PaUtil_Set*InputChannels functions to a user supplied buffer. This function is intended for use with blocking read/write streams. Copies the minimum of the number of user frames (specified by the frameCount parameter) and the number of available host frames (specified in a previous call to SetInputFrameCount()). @param bufferProcessor The buffer processor. @param buffer A pointer to the user buffer pointer, or a pointer to a pointer to an array of user buffer pointers for a non-interleaved stream. It is important that this parameter points to a copy of the user buffer pointers, not to the actual user buffer pointers, because this function updates the pointers before returning. @param frameCount The number of frames of data in the buffer(s) pointed to by the buffer parameter. @return The number of frames copied. The buffer pointer(s) pointed to by the buffer parameter are advanced to point to the frame(s) following the last one filled.*/unsigned long PaUtil_CopyInput( PaUtilBufferProcessor* bufferProcessor, void **buffer, unsigned long frameCount );/* Copy samples from a user supplied buffer to host output channels set up by the PaUtil_Set*OutputChannels functions. This function is intended for use with blocking read/write streams. Copies the minimum of the number of user frames (specified by the frameCount parameter) and the number of host frames (specified in a previous call to SetOutputFrameCount()). @param bufferProcessor The buffer processor. @param buffer A pointer to the user buffer pointer, or a pointer to a pointer to an array of user buffer pointers for a non-interleaved stream. It is important that this parameter points to a copy of the user buffer pointers, not to the actual user buffer pointers, because this function updates the pointers before returning. @param frameCount The number of frames of data in the buffer(s) pointed to by the buffer parameter. @return The number of frames copied. The buffer pointer(s) pointed to by the buffer parameter are advanced to point to the frame(s) following the last one copied.*/unsigned long PaUtil_CopyOutput( PaUtilBufferProcessor* bufferProcessor, const void ** buffer, unsigned long frameCount );/* Zero samples in host output channels set up by the PaUtil_Set*OutputChannels functions. This function is useful for flushing streams. Zeros the minimum of frameCount and the number of host frames specified in a previous call to SetOutputFrameCount(). @param bufferProcessor The buffer processor. @param frameCount The maximum number of frames to zero. @return The number of frames zeroed.*/unsigned long PaUtil_ZeroOutput( PaUtilBufferProcessor* bufferProcessor, unsigned long frameCount );/*@}*/#ifdef __cplusplus}#endif /* __cplusplus */#endif /* PA_PROCESS_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -