readme.txt 1.2 KB

123456789101112131415161718192021222324252627282930
  1. 版本:v1.0.0
  2. 维护:陈伟桦
  3. 一、获取语音识别帮助类
  4. 包名:com.invision.speech
  5. SDKSpeechManager getSDKSpeechManager(Context context)
  6. Unity范例:
  7. AndroidJavaClass mUnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
  8. AndroidJavaObject mAndroidActivity = mUnityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
  9. AndroidJavaObject mContext = mAndroidActivity.Call<AndroidJavaObject>("getApplicationContext");
  10. AndroidJavaClass mClazz = new AndroidJavaClass("com.invision.speech.SDKSpeechManager");
  11. AndroidJavaObject mSDKSpeechManager = mClazz.CallStatic<AndroidJavaObject>("getSDKSpeechManager", mContext);
  12. 二、设置语音回调函数
  13. SpeechEventCallback包名变更:com.invision.speech.callback
  14. setSpeechEventCallback(SpeechEventCallback speechEventCallback)
  15. 三、判断语音识别是否在运行(对应原来的接口unityIsSpeechRunning())
  16. isSpeechRunning()
  17. 四、开启识别服务(对应原来的接口unityStartSpeechService())
  18. startSpeechService()
  19. 五、关闭识别服务(对应原来的接口unityStopSpeechService())
  20. stopSpeechService()
  21. 六、关闭语音识别帮助类时候调用,比如退出程序或者程序需要的地方
  22. onDestroy()