public MainWindow() { InitializeComponent(); _subtitles = new List <string>(); _subtitleDurationsInMilliseconds = new List <int>(); _hlsProcessor = new HLSProcessor(BingSpeechToTextApiSubscriptionKey); _hlsProcessor.MediaSegmentProcessed += OnHlsMediaSegmentProcessed; _mediaSegmentBuffer = new MediaSegmentBuffer(); _mediaSegmentBuffer.BufferChanged += OnMediaSegmentBufferChanged; Loaded += OnMainWindowLoaded; mediaElement.LoadedBehavior = MediaState.Manual; mediaElement.MediaEnded += OnMediaElementMediaEnded; }
static void Main(string[] args) { _hlsProcessor = new HLSProcessor(BingSpeechToTextApiSubscriptionKey); _hlsProcessor.MediaSegmentProcessed += OnMediaSegmentProcessed; MainAsync().GetAwaiter().GetResult(); }