private IEnumerator DoSendApi() { var request = new UnityWebRequest(string.Format(RecognizeUrlFormat, _apiKey), UnityWebRequest.kHttpVerbPOST); request.uploadHandler = new UploadHandlerRaw(Encoding.UTF8.GetBytes(JsonUtility.ToJson(_parameter))); request.downloadHandler = new DownloadHandlerBuffer(); request.SetRequestHeader("Content-Type", "application/json"); yield return(request.SendWebRequest()); Debug.Log("Result : " + request.downloadHandler.text); var result = JsonUtility.FromJson <SpeechRecognitionResultParameter>(request.downloadHandler.text); OnRecognitionResult?.Invoke(result); }
private void ObjASR_OnFinalResult(object sender, RecognitionResult e) { OnRecognitionResult?.Invoke(e); }