FreeRDP
Loading...
Searching...
No Matches
win_wasapi.h
1
19#ifndef FREERDP_SERVER_SHADOW_WIN_WASAPI_H
20#define FREERDP_SERVER_SHADOW_WIN_WASAPI_H
21
22/* WASAPI loopback capture, kept apart from FreeRDP's audio headers: the
23 * Windows ones (mmreg.h) define macros that clash with them */
24
25#include <winpr/wtypes.h>
26#include <winpr/stream.h>
27
28/* What the capture delivers: 16-bit stereo at 48 kHz */
29#define WIN_WASAPI_RATE 48000
30#define WIN_WASAPI_CHANNELS 2
31#define WIN_WASAPI_FRAME_BYTES 4
32
33typedef struct win_wasapi_loopback winWasapiLoopback;
34
35#ifdef __cplusplus
36extern "C"
37{
38#endif
39
40 /* Starts loopback capture on the default render endpoint: what the
41 * speakers play. The calling thread has COM initialized. log is FALSE
42 * while retrying after a failure that was reported. */
43 WINPR_ATTR_NODISCARD winWasapiLoopback* win_wasapi_loopback_open(BOOL log);
44 void win_wasapi_loopback_close(winWasapiLoopback* loopback);
45
46 /* Appends what was captured since the last call to s. FALSE when the
47 * capture stopped: the endpoint went away (unplugged, the default
48 * changed, the audio service stopped) or memory ran out. */
49 WINPR_ATTR_NODISCARD BOOL win_wasapi_loopback_read(winWasapiLoopback* loopback, wStream* s);
50
51#ifdef __cplusplus
52}
53#endif
54
55#endif /* FREERDP_SERVER_SHADOW_WIN_WASAPI_H */