#pragma once #include "captions-handler.hpp" #include "captions-mssapi-stream.hpp" #include #include #include #include #include #include #include #include #include class mssapi_captions : public captions_handler { friend class CaptionStream; ComPtr audio; ComPtr token; ComPtr grammar; ComPtr recognizer; ComPtr context; HANDLE notify; WinHandle stop; std::thread t; bool started = false; void main_thread(); public: mssapi_captions(captions_cb callback, const std::string &lang); virtual ~mssapi_captions(); virtual void pcm_data(const void *data, size_t frames) override; };