public SpeechRecRes SpeechRec(string filePath) { SpeechRecRes res = null; if (!string.IsNullOrEmpty(filePath) && File.Exists(filePath)) { res = SpeechRec(File.ReadAllBytes(filePath)); } return(res); }
public SpeechRecRes SpeechRec(byte[] data) { SpeechRecRes res = null; if (data != null) { JObject result = _asr.Recognize(data, _speechFormat, 16000); res = result?.ToObject <SpeechRecRes>(); } return(res); }