1 #ifndef PA_WIN_WASAPI_H
2 #define PA_WIN_WASAPI_H
58 typedef enum PaWasapiFlags
61 paWinWasapiExclusive = (1 << 0),
64 paWinWasapiRedirectHostProcessor = (1 << 1),
67 paWinWasapiUseChannelMask = (1 << 2),
70 paWinWasapiPolling = (1 << 3),
74 paWinWasapiThreadPriority = (1 << 4),
79 paWinWasapiExplicitSampleFormat = (1 << 5),
85 paWinWasapiAutoConvert = (1 << 6),
90 paWinWasapiPassthrough = (1 << 7),
93 #define paWinWasapiExclusive (paWinWasapiExclusive)
94 #define paWinWasapiRedirectHostProcessor (paWinWasapiRedirectHostProcessor)
95 #define paWinWasapiUseChannelMask (paWinWasapiUseChannelMask)
96 #define paWinWasapiPolling (paWinWasapiPolling)
97 #define paWinWasapiThreadPriority (paWinWasapiThreadPriority)
98 #define paWinWasapiExplicitSampleFormat (paWinWasapiExplicitSampleFormat)
99 #define paWinWasapiAutoConvert (paWinWasapiAutoConvert)
100 #define paWinWasapiPassthrough (paWinWasapiPassthrough)
108 typedef enum PaWasapiStreamState
116 paWasapiStreamStateError = (1 << 0),
119 paWasapiStreamStateThreadPrepare = (1 << 1),
122 paWasapiStreamStateThreadStart = (1 << 2),
125 paWasapiStreamStateThreadStop = (1 << 3)
128 #define paWasapiStreamStateError (paWasapiStreamStateError)
129 #define paWasapiStreamStateThreadPrepare (paWasapiStreamStateThreadPrepare)
130 #define paWasapiStreamStateThreadStart (paWasapiStreamStateThreadStart)
131 #define paWasapiStreamStateThreadStop (paWasapiStreamStateThreadStop)
143 typedef void (*PaWasapiHostProcessorCallback) (
void *inputBuffer,
long inputFrames,
144 void *outputBuffer,
long outputFrames,
void *userData);
156 typedef void (*PaWasapiStreamStateCallback) (
PaStream *pStream,
unsigned int stateFlags,
157 unsigned int errorId,
void *pUserData);
161 typedef enum PaWasapiDeviceRole
163 eRoleRemoteNetworkDevice = 0,
170 eRoleUnknownDigitalPassthrough,
173 eRoleUnknownFormFactor
179 typedef enum PaWasapiJackConnectionType
181 eJackConnTypeUnknown,
182 eJackConnType3Point5mm,
183 eJackConnTypeQuarter,
184 eJackConnTypeAtapiInternal,
186 eJackConnTypeOptical,
187 eJackConnTypeOtherDigital,
188 eJackConnTypeOtherAnalog,
189 eJackConnTypeMultichannelAnalogDIN,
190 eJackConnTypeXlrProfessional,
191 eJackConnTypeRJ11Modem,
192 eJackConnTypeCombination
194 PaWasapiJackConnectionType;
198 typedef enum PaWasapiJackGeoLocation
201 eJackGeoLocRear = 0x1,
207 eJackGeoLocRearPanel,
209 eJackGeoLocInsideMobileLid,
212 eJackGeoLocOutsideMobileLid,
214 eJackGeoLocReserved5,
215 eJackGeoLocReserved6,
217 PaWasapiJackGeoLocation;
221 typedef enum PaWasapiJackGenLocation
223 eJackGenLocPrimaryBox = 0,
228 PaWasapiJackGenLocation;
232 typedef enum PaWasapiJackPortConnection
234 eJackPortConnJack = 0,
235 eJackPortConnIntegratedDevice,
236 eJackPortConnBothIntegratedAndJack,
239 PaWasapiJackPortConnection;
245 eThreadPriorityNone = 0,
247 eThreadPriorityCapture,
248 eThreadPriorityDistribution,
249 eThreadPriorityGames,
250 eThreadPriorityPlayback,
252 eThreadPriorityWindowManager
260 unsigned long channelMapping;
262 PaWasapiJackConnectionType connectionType;
263 PaWasapiJackGeoLocation geoLocation;
264 PaWasapiJackGenLocation genLocation;
265 PaWasapiJackPortConnection portConnection;
266 unsigned int isConnected;
281 eAudioCategoryOther = 0,
282 eAudioCategoryCommunications = 3,
283 eAudioCategoryAlerts = 4,
284 eAudioCategorySoundEffects = 5,
285 eAudioCategoryGameEffects = 6,
286 eAudioCategoryGameMedia = 7,
287 eAudioCategoryGameChat = 8,
288 eAudioCategorySpeech = 9,
289 eAudioCategoryMovie = 10,
290 eAudioCategoryMedia = 11
322 ePassthroughFormatPcmIec60958 = 0x00000000,
323 ePassthroughFormatDolbyDigital = 0x00920000,
324 ePassthroughFormatMpeg1 = 0x00030cea,
325 ePassthroughFormatMpeg3 = 0x00040cea,
326 ePassthroughFormatMpeg2 = 0x00050cea,
327 ePassthroughFormatAac = 0x00060cea,
328 ePassthroughFormatDts = 0x00080cea,
329 ePassthroughFormatDolbyDigitalPlus = 0x000a0cea,
330 ePassthroughFormatDolbyDigitalPlusAtmos = 0x010a0cea,
331 ePassthroughFormatDtsHd = 0x000b0cea,
332 ePassthroughFormatDtsXE1 = 0x010b0cea,
333 ePassthroughFormatDtsXE2 = 0x030b0cea,
334 ePassthroughFormatDolbyMlp = 0x000c0cea,
335 ePassthroughFormatDolbyMat20 = 0x010c0cea,
336 ePassthroughFormatDolbyMat21 = 0x030c0cea,
337 ePassthroughFormatWmaPro = 0x01640000,
338 ePassthroughFormatAtrac = 0x00080cea,
339 ePassthroughFormatOneBitAudio = 0x00090cea,
340 ePassthroughFormatDst = 0x000d0cea,
359 unsigned int encodedSamplesPerSec;
360 unsigned int encodedChannelCount;
361 unsigned int averageBytesPerSec;
389 PaWasapiHostProcessorCallback hostProcessorInput;
685 const PaWasapiDeviceRole *pRole,
unsigned int count,
int bOutput );
PaError PaWasapi_GetFramesPerHostBuffer(PaStream *pStream, unsigned int *pInput, unsigned int *pOutput)
PaError PaWasapi_SetStreamStateHandler(PaStream *pStream, PaWasapiStreamStateCallback fnStateHandler, void *pUserData)
PaWasapiHostProcessorCallback hostProcessorOutput
PaError PaWasapi_ThreadPriorityBoost(void **pTask, PaWasapiThreadPriority priorityClass)
int PaWasapi_IsLoopback(PaDeviceIndex device)
bypass WASAPI Audio Engine DSP effects, supported since Windows 8.1
PaError PaWasapi_GetIMMDevice(PaDeviceIndex device, void **pIMMDevice)
int PaWasapi_GetDeviceDefaultFormat(void *pFormat, unsigned int formatSize, PaDeviceIndex device)
PaError PaWasapi_GetJackCount(PaDeviceIndex device, int *pJackCount)
PaWasapiStreamCategory streamCategory
PaWasapiThreadPriority threadPriority
PaWasapiStreamPassthrough passthrough
PaError PaWasapi_GetAudioClient(PaStream *pStream, void **pAudioClient, int bOutput)
Default for Exclusive mode.
force WASAPI Audio Engine into a stream format, supported since Windows 10
The portable PortAudio API.
PaError PaWasapi_UpdateDeviceList()
PaError PaWasapi_GetJackDescription(PaDeviceIndex device, int jackIndex, PaWasapiJackDescription *pJackDescription)
PaWasapiPassthroughFormat
PaHostApiTypeId hostApiType
PaWinWaveFormatChannelMask channelMask
int PaWasapi_GetDeviceMixFormat(void *pFormat, unsigned int formatSize, PaDeviceIndex device)
PaError PaWasapiWinrt_SetDefaultDeviceId(const unsigned short *pId, int bOutput)
PaError PaWasapi_ThreadPriorityRevert(void *pTask)
int PaWasapi_GetDeviceCurrentFormat(PaStream *pStream, void *pFormat, unsigned int formatSize, int bOutput)
struct PaWasapiStreamPassthrough PaWasapiStreamPassthrough
PaError PaWasapiWinrt_PopulateDeviceList(const unsigned short **pId, const unsigned short **pName, const PaWasapiDeviceRole *pRole, unsigned int count, int bOutput)
PaWasapiStreamOption streamOption
int PaWasapi_GetDeviceRole(PaDeviceIndex device)