You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+69-9Lines changed: 69 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,27 +30,87 @@ If you like my general work and contributions consider [sponsoring me on Github]
30
30
31
31
But if you just want to donate straightforward, I also have [PayPal.me](https://paypal.me/EricBatlleClavero?locale.x=es_ES).
32
32
33
-
## How to Use ⚙️
33
+
## How to Install :hammer_and_wrench:
34
+
35
+
- If you want to install the the app, you can download the APK from [here](https://github.com/EricBatlle/UnityAndroidSpeechRecognizer/releases/download/v1.3/SpeechRecognizer_1.3.apk).
34
36
35
-
If you want to test the app, you can download the APK from [here](https://github.com/EricBatlle/UnityAndroidSpeechRecognizer/releases/download/v1.2/SpeechRecognizer_1.2.apk).
37
+
-If you want to install the whole project and check the code, you need to have **Unity** and **AndroidStudio** installed and updated.
36
38
37
-
If you want to open the project and check the code, you need to have **Unity** and**AndroidStudio**installed and updated.
39
+
-If you want to install only the few files to make the plugin work and don't want the whole project, you only need to import the package**SpeechRecognizer_pckg**located inside ``UnitySpeechRecognizer/Assets/``. To import it simply drag and drop the file in your current Unity project.
38
40
39
-
If you want to scratch the code:
41
+
## How to Use ⚙️
40
42
43
+
#### How to use the Demo:
44
+
- Functionality is simple, just press the **Start Listening button** and talk to your device to check the results!
45
+
- If you want to enable/disable continuous listening mode simply press the **Continous Listening checkmark**.
46
+
- You can also stop the current recongizer by pressing the **Stop Listening button**.
47
+
- Set the language of the recognizer or the maximum results you want that the recognizer retrieves.
48
+
49
+
#### How to use the Plugin:
50
+
51
+
To call the plugin you first need a variable to reference it:
52
+
```csharp
53
+
privateSpeechRecognizerPluginplugin=null;
54
+
```
55
+
Then you have to create a new platform-specific instance by calling:
Notice that ``this.gameObject.name`` is the name of the GameObject that will have the plugin callback methods to retrieve the recognition results and errors.
60
+
To create those callbacks you need to add and implement the Interface ```ISpeechRecognizerPlugin``` on the same GameObject. A common implementation of the interface will be:
Debug.Log("<b>ERROR: </b> Language format is not valid");
80
+
break;
81
+
default:
82
+
break;
83
+
}
84
+
}
85
+
```
86
+
From so on every time you want to call any plugin feature you only have to call it like any other object:
87
+
88
+
Do you want to start the recognition?
89
+
```csharp
90
+
plugin.StartListening();
91
+
```
92
+
Do you want to stop it?
93
+
```csharp
94
+
plugin.StopListening();
95
+
```
96
+
Do you want to start the recognition with continous recognition and specific language?
97
+
```csharp
98
+
plugin.StartListening(true, "es-ES");
99
+
```
100
+
101
+
#### How to scratch the code:
41
102
- To check **Unity** project, **open the project**, select **SpeechRecognizer** scene.
42
103
Either inside the unity project or simply dragging the **.cs** classes on your editor, you have to watch on to the classes located on ``UnitySpeechRecognizer/Assets/Scripts``.
43
104
- To check **Android Plugin** you can do it opening the solution with **AndroidStudio** or just drag the ``SpeechRecognizerFragment.java`` class located on ``UnitySpeechRecognizerPlugin\SpeechRecognizer\src\main\java\com\example\eric\unityspeechrecognizerplugin``
44
105
45
-
Functionality is simple, just press the checkmark if you want to enable/disable continuous listening mode, press Start listening and talk to your device to check the results!
46
106
47
-
####Multiple plugins support 🔌
107
+
## Multiple plugins support 🔌
48
108
This plugin has been made following a **fragment-pattern** to avoid errors that can be derived from extending *UnityPlayerActivity*.
49
109
50
110
This way you can integrate this plugin with your projects even if they already have more plugins. **Truly pluggable**.
51
111
52
-
####Upgrading dependencies 📜
112
+
## Upgrading dependencies 📜
53
113
54
-
Keep in mind that the actual release ([v1.2](https://github.com/EricBatlle/UnityAndroidSpeechRecognizer/releases/tag/v1.2)) of the plugin works with **AndroidX** dependencies. That means that is targeting **Android 9** (API level 28).
114
+
Keep in mind that the actual release ([v1.3](https://github.com/EricBatlle/UnityAndroidSpeechRecognizer/releases/tag/v1.3)) of the plugin works with **AndroidX** dependencies. That means that is targeting **Android 9** (API level 28).
55
115
56
-
If you want to target older versions I recommend to use the old version of the plugin ([v1.0]((https://github.com/EricBatlle/UnityAndroidSpeechRecognizer/releases/tag/v1.0))) that works with **Android Support v4**. You can download the old plugin source code and APK from [here](https://github.com/EricBatlle/UnityAndroidSpeechRecognizer/releases/tag/v1.0).
116
+
If you want to target older versions I recommend to use the old version of the plugin ([v1.0]((https://github.com/EricBatlle/UnityAndroidSpeechRecognizer/releases/tag/v1.0))) that works with **Android Support v4**. *But remember that some features like specify recognition language aren't available for the moment.*You can download the old plugin source code and APK from [here](https://github.com/EricBatlle/UnityAndroidSpeechRecognizer/releases/tag/v1.0).
0 commit comments