예제 #1
0
        public SpeechRecRes SpeechRec(string filePath)
        {
            SpeechRecRes res = null;

            if (!string.IsNullOrEmpty(filePath) && File.Exists(filePath))
            {
                res = SpeechRec(File.ReadAllBytes(filePath));
            }

            return(res);
        }
예제 #2
0
        public SpeechRecRes SpeechRec(byte[] data)
        {
            SpeechRecRes res = null;

            if (data != null)
            {
                JObject result = _asr.Recognize(data, _speechFormat, 16000);

                res = result?.ToObject <SpeechRecRes>();
            }

            return(res);
        }