ListAvailableEndpoints ( ) Global $g_sID_Endpoint = _WASAPI _GetDefaultAudioEndpoint ( $eRender ) Global $aEpInfo = _WASAPI _EndpointInfo ( $g_sID_Endpoint ) ConsoleWrite ( "Capturing From: " & $aEpInfo & & "ESC key ends capture" & ) For more information about audio loopback, see Loopback Recording.Įxpand collapse popup Bilgus 2019 #include 'WasApi_3' #include _IsPressed #include Global Const $sTmpFile = & "\wavecap.raw" Global $g_hUser32 = DllOpen ( "user32.dll" ) OnAutoItExitRegister ( "_Exit" ) Note that all streams must be opened in share mode because exclusive-mode streams cannot operate in loopback mode.
As of Windows 10 the relevant event handles are now set for loopback-enabled streams that are active. Each time the client receives an event for the render stream, it must signal the capture client to run the capture thread that reads the next set of samples from the capture endpoint buffer. To work around this, initialize a render stream in event-driven mode. If the stream is opened with this configuration, the Initialize call succeeds, but relevant events are not raised to notify the capture client each time a buffer becomes ready for processing.
On Windows versions prior to Windows 10, a pull-mode capture client will not receive any events when a stream is initialized with event-driven buffering (AUDCLNT_STREAMFLAGS_EVENTCALLBACK) and is loopback-enabled (AUDCLNT_STREAMFLAGS_LOOPBACK).