public static async Task ConvertTest(IRecognizer recognizer, string name, string expected) { var bytes = ResourcesUtilities.ReadFileAsBytes(name); var actual = await recognizer.ConvertAsync(bytes); Assert.AreEqual(expected, actual); }
public static async Task ConvertTest_RealTime(IRecorder recorder, IRecognizer recognizer) { using var recognition = await recorder.StartAsync(recognizer.SupportedSettings.First()); await Task.Delay(TimeSpan.FromSeconds(5)); await recognition.StopAsync(); var bytes = recognition.Data; Assert.IsNotNull(bytes, $"{nameof(bytes)} == null"); var result = await recognizer.ConvertAsync(bytes); Console.WriteLine(result); }