#pragma once #include #include #include #include #include namespace linkshell { // Native WASAPI Loopback audio capturer -> 48 kHz stereo PCM16 (20 ms frames), // framed with @linkshell/wire's 8-byte big-endian screen-audio header for the "audio" DataChannel. class AudioCapturer { public: using PacketCallback = std::function; using LogFn = std::function; AudioCapturer(PacketCallback on_packet, LogFn log = {}); ~AudioCapturer(); void Start(); void Stop(); bool running() const { return running_.load(); } private: void RunLoop(); PacketCallback on_packet_; LogFn log_; std::atomic running_{false}; std::thread thread_; }; } // namespace linkshell