【文件属性】:
文件名称:Google Cloud Speech Recognition 3.0
文件大小:987KB
文件格式:UNITYPACKAGE
更新时间:2020-09-25 06:49:14
Google Cloud Speech Recognition Unity
Google Cloud Speech Recognition
How to use
First of all, you need to add GCSpeechRecognition prefab from FrostweepGames->GCSpeechRecognition->Prefabs
folder to your working scene.
Then you need to set your own API key of Google Cloud Speech Recognition into Api Key field and enable
IsUseAPIKeyFromPrefab if you want to set api key in prefab, if not – will be used API Key from Constants.cs script.
If you don’t have API Key, you can get it from https://cloud.google.com/speech/ ,
https://cloud.google.com/speech/docs/common/auth#restrictions
Frostweep Games, 2017
Then we need to create script with name Example and write base logic:
You can handle response of Speech Recognition in SpeechRecognizedSuccessEventHandler
To get result of the recognition you can use RecognitionResponse->results->alternatives->transcript path. Where
RecognitionResponse is an instance of the RecognitionResponse object.
For the start recording you can call this method:
Include Boolean parameter for enabling runtime voice detection or not.
For the stop recording you can call this method:
For set the list of arrays of speech contexts you can call this method:
Frostweep Games, 2017
_speechRecognition is an instance of GCSpeechRecognition class:
If you want to set language you can call this method (where value is integer converted to LanguageCode enum):