/* Host processor. Allows to skip internal PA processing completely. \r
You must set paWinWasapiRedirectHostProcessor flag to PaWasapiStreamInfo::flags member\r
in order to have host processor redirected to your callback.\r
- Use with caution! inputFrames and outputFrames depend solely on final device setup (buffer\r
- size is just recommendation) but are not changing during run-time once stream is started.\r
+ Use with caution! inputFrames and outputFrames depend solely on final device setup.\r
+ To query maximal values of inputFrames/outputFrames use PaWasapi_GetFramesPerHostBuffer.\r
*/\r
typedef void (*PaWasapiHostProcessorCallback) (void *inputBuffer, long inputFrames,\r
void *outputBuffer, long outputFrames,\r
/** Returns default sound format for device. Format is represented by PaWinWaveFormat or \r
WAVEFORMATEXTENSIBLE structure.\r
\r
- @param pFormat pointer to PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure.\r
- @param nFormatSize pize of PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure in bytes.\r
- @param nDevice device index.\r
+ @param pFormat Pointer to PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure.\r
+ @param nFormatSize Size of PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure in bytes.\r
+ @param nDevice Device index.\r
\r
- @return A non-negative value indicating the number of bytes copied into format decriptor\r
+ @return Non-negative value indicating the number of bytes copied into format decriptor\r
or, a PaErrorCode (which are always negative) if PortAudio is not initialized\r
or an error is encountered.\r
*/\r
\r
@param nDevice device index.\r
\r
- @return A non-negative value indicating device role or, a PaErrorCode (which are always negative)\r
+ @return Non-negative value indicating device role or, a PaErrorCode (which are always negative)\r
if PortAudio is not initialized or an error is encountered.\r
*/\r
int/*PaWasapiDeviceRole*/ PaWasapi_GetDeviceRole( PaDeviceIndex nDevice );\r
/** Boost thread priority of calling thread (MMCSS). Use it for Blocking Interface only for thread\r
which makes calls to Pa_WriteStream/Pa_ReadStream.\r
\r
- @param hTask a handle to pointer to priority task. Must be used with PaWasapi_RevertThreadPriority\r
+ @param hTask Handle to pointer to priority task. Must be used with PaWasapi_RevertThreadPriority\r
method to revert thread priority to initial state.\r
\r
- @param nPriorityClass an Id of thread priority of PaWasapiThreadPriority type. Specifying \r
+ @param nPriorityClass Id of thread priority of PaWasapiThreadPriority type. Specifying \r
eThreadPriorityNone does nothing.\r
\r
@return Error code indicating success or failure.\r
- @see PaWasapi_RevertThreadPriority\r
+ @see PaWasapi_RevertThreadPriority\r
*/\r
PaError PaWasapi_ThreadPriorityBoost( void **hTask, PaWasapiThreadPriority nPriorityClass );\r
\r
/** Boost thread priority of calling thread (MMCSS). Use it for Blocking Interface only for thread\r
which makes calls to Pa_WriteStream/Pa_ReadStream.\r
\r
- @param hTask Task handle obtained by PaWasapi_BoostThreadPriority method.\r
+ @param hTask Task handle obtained by PaWasapi_BoostThreadPriority method.\r
@return Error code indicating success or failure.\r
- @see PaWasapi_BoostThreadPriority\r
+ @see PaWasapi_BoostThreadPriority\r
*/\r
PaError PaWasapi_ThreadPriorityRevert( void *hTask );\r
\r
\r
+/** Get number of frames per host buffer. This is maximal value of frames of WASAPI buffer which \r
+ can be locked for operations. Use this method as helper to findout maximal values of \r
+ inputFrames/outputFrames of PaWasapiHostProcessorCallback.\r
+\r
+ @param pStream Pointer to PaStream to query.\r
+ @param nInput Pointer to variable to receive number of input frames. Can be NULL.\r
+ @param nOutput Pointer to variable to receive number of output frames. Can be NULL.\r
+ @return Error code indicating success or failure.\r
+ @see PaWasapiHostProcessorCallback\r
+*/\r
+PaError PaWasapi_GetFramesPerHostBuffer( PaStream *pStream, unsigned int *nInput, unsigned int *nOutput );\r
+\r
+\r
/*\r
IMPORTANT:\r
\r
two versions:\r
\r
1) Event-Driven:\r
- This is the most powerful WASAPI implementation which is capable to provides glitch-free\r
- audio at 2ms latency in Exclusive mode. Lowest possible latency for this mode is \r
- usually - 2ms for HD Audio class audio chips (including on-board audio, 2ms was achieved \r
- on Realtek ALC888/S/T). For Shared mode latency can not go lower than 20ms.\r
+ This is the most powerful WASAPI implementation which provides glitch-free\r
+ audio at around 3ms latency in Exclusive mode. Lowest possible latency for this mode is \r
+ usually - 1.4(Vista only)-3ms(Windows 7+) for HD Audio class audio chips. For the \r
+ Shared mode latency can not be lower than 20ms.\r
\r
2) Poll-Driven:\r
Polling is another 2-nd method to operate with WASAPI. It is less efficient than Event-Driven\r
- and provides latency at around 12-13ms. Polling must be used to overcome a system bug\r
- under Windows Vista x64 when application is WOW64(32-bit) and Event-Driven method simply times\r
- out (event handle is never signalled on buffer completion). Please note, such Vista bug \r
- does not exist in Windows 7 x64.\r
- Polling is setup by speciying 'paWinWasapiPolling' flag.\r
- Thread priority can be boosted by specifying 'paWinWasapiBlockingThreadPriorityPro' flag.\r
+ and provides latency at around 10-13ms. Polling must be used to overcome a system bug\r
+ under Windows Vista x64 when application is WOW64(32-bit) and Event-Driven method simply \r
+ times out (event handle is never signalled on buffer completion). Please note, such WOW64 bug \r
+ does not exist in Vista x86 or Windows 7.\r
+ Polling can be setup by speciying 'paWinWasapiPolling' flag. Our WASAPI implementation detects\r
+ WOW64 bug and sets 'paWinWasapiPolling' automatically.\r
+\r
+ Thread priority:\r
+\r
+ Normally thread priority is set automatically and does not require modification. Although\r
+ if user wants some tweaking thread priority can be modified by setting 'paWinWasapiThreadPriority'\r
+ flag and specifying 'PaWasapiStreamInfo::threadPriority' with value from PaWasapiThreadPriority \r
+ enum.\r
\r
Blocking Interface:\r
\r
Blocking interface is implemented but due to above described Poll-Driven method can not\r
- deliver low latency audio. Specifying too low latency in Shared mode will result in \r
+ deliver lowest possible latency. Specifying too low latency in Shared mode will result in \r
distorted audio although Exclusive mode adds stability.\r
\r
Pa_IsFormatSupported:\r