Comments (18)
We have same problem. Can you share the solution with us, if you fixed the issue?
from speech-and-text-unity-ios-android.
@medinags you have to make this changes in android studio with java like @PersistantStudio said.
from speech-and-text-unity-ios-android.
SpeechToTextPlugin.jar.zip
Anybody suffering from this problem can first update their files from the repository to latest (specially SpeechToText.cs and TextToSpeech.cs) and then replace their jar file from "Assets/Plugins/Android/SpeechToTextPlugin.jar". I have followed and updated @kayabilgehan solution as it had a type casting error and compiled the files from android studio.
Thanks @PersistantStudio and @kayabilgehan for your efforts :)
from speech-and-text-unity-ios-android.
We are having the same issue. The app crashes if you try to hide the pop up. But it works fine if you show the pop up (which covers the whole app).
Did anybody come up with any solutions to this?
from speech-and-text-unity-ios-android.
We were able to fix the problem, wich is pretty simple to adress
Just adding null checks ans size check before accessing the entry 0 in the array in OnResults & OnPartialResults.
public void onResults(Bundle results) {
ArrayList<String> text = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
if(text != null && text.size() >0) {
UnityPlayer.UnitySendMessage("SpeechToText", "onResults", text.get(0));
}
}
@Override
public void onPartialResults(Bundle partialResults) {
ArrayList<String> text = partialResults.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
if(text != null && text.size() >0) {
UnityPlayer.UnitySendMessage("SpeechToText", "onPartialResults", text.get(0));
}
}`
```
The hardest part was in fact to build the plugin thas is really outdated. It's way easier to start from scratch in fact.
>
from speech-and-text-unity-ios-android.
@PersistantStudio , Thank you.
It took us a whole day to get android studio to compile this. We had already added a check on text.size()
but adding the check for null
fixed the crash. That being said, our app is now stuck, which I assume is because if the if
is not true (the text is empty) nothing is sent to Unity. We are working on fixing this by sending an empty string. Maybe that works!!
Thanks again.
from speech-and-text-unity-ios-android.
I think we encountered the same issue.The call are made by name on gameobject on the Java side, so the name in Unity3D need to match the one defined in the Java plugin. The code on this repo contains an error in the way the game object is named in Unity : It is actually named TextToSpeech instead of SpeechToText when you use the lazy instanciation. Correcting this error will fix the issue of not getting any callbacks.
from speech-and-text-unity-ios-android.
We fixed the issue by storing the text created in "onPartialResults" in a variable and if the data comes from "onResults" is null, than we use the stored text data.
Code:
private Intent intent;
String partialStringResult = ""; //variable to store text from onPartialResults
@OverRide
public void onCreate(Bundle savedInstanceState) {
.
.
.
@OverRide
public void onResults(Bundle results) {
ArrayList text = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
if(text != null && text.size() > 0) {
UnityPlayer.UnitySendMessage("SpeechToText", "onResults", text.get(0));
}
else if(partialStringResult != null && !partialStringResult.equals("")) {
UnityPlayer.UnitySendMessage("SpeechToText", "onResults", partialStringResult); //send unity the stored string
}
}
@OverRide
public void onPartialResults(Bundle partialResults) {
ArrayList text = partialResults.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
if(text != null && text.size() > 0) {
partialStringResult = text.get(0); //store data to use it if needed
UnityPlayer.UnitySendMessage("SpeechToText", "onPartialResults", text.get(0));
}
}
Edit:
After these changes in Java I made changes below too in build.gradle in app level.
task deleteOldJar(type: Delete) {
delete 'release/SpeechToTextPlugin.jar'
}
//task to export content as jar
task exportJar(type: Copy) {
from('build/intermediates/compile_library_classes_jar/release/')
into('release/')
include('classes.jar')
rename('classes.jar', 'SpeechToTextPlugin.jar')
}
exportJar.dependsOn(deleteOldJar, build)
from speech-and-text-unity-ios-android.
@kayabilgehan Thanks for your solution, but my question is where should I implement this solution, in Unity?
from speech-and-text-unity-ios-android.
Nope the modifications needs to be made in the java project of the plugin.
from speech-and-text-unity-ios-android.
hello, sorry i have the same question, i m new with unity and i do this task, where i can found the java project of the plugin please?
from speech-and-text-unity-ios-android.
I have the same problem and when I installed Android Studio it told me that I need HAXM to work, but my computer does not meet the requirements. What can I do to edit the plugin?
from speech-and-text-unity-ios-android.
Can anyone share the plugin already fixed?
from speech-and-text-unity-ios-android.
SpeechToTextPlugin.jar.zip Anybody suffering from this problem can first update their files from the repository to latest (specially SpeechToText.cs and TextToSpeech.cs) and then replace their jar file from "Assets/Plugins/Android/SpeechToTextPlugin.jar". I have followed and updated @kayabilgehan solution as it had a type casting error and compiled the files from android studio. Thanks @PersistantStudio and @kayabilgehan for your efforts :)
hello ,thank you for the reply but even i change the jar file and update the two files of textspeech and speechtotext it's does'nt work
from speech-and-text-unity-ios-android.
SpeechToTextPlugin.jar.zip Anybody suffering from this problem can first update their files from the repository to latest (specially SpeechToText.cs and TextToSpeech.cs) and then replace their jar file from "Assets/Plugins/Android/SpeechToTextPlugin.jar". I have followed and updated @kayabilgehan solution as it had a type casting error and compiled the files from android studio. Thanks @PersistantStudio and @kayabilgehan for your efforts :)
This fixed the issue. Thank you so much man! <3
from speech-and-text-unity-ios-android.
SpeechToTextPlugin.jar.zip Anybody suffering from this problem can first update their files from the repository to latest (specially SpeechToText.cs and TextToSpeech.cs) and then replace their jar file from "Assets/Plugins/Android/SpeechToTextPlugin.jar". I have followed and updated @kayabilgehan solution as it had a type casting error and compiled the files from android studio. Thanks @PersistantStudio and @kayabilgehan for your efforts :)
Saved my life @Aneeb151. Thank you very much!
from speech-and-text-unity-ios-android.
SpeechToTextPlugin.jar.zip Anybody suffering from this problem can first update their files from the repository to latest (specially SpeechToText.cs and TextToSpeech.cs) and then replace their jar file from "Assets/Plugins/Android/SpeechToTextPlugin.jar". I have followed and updated @kayabilgehan solution as it had a type casting error and compiled the files from android studio. Thanks @PersistantStudio and @kayabilgehan for your efforts :)
Thanks a lot brother!
from speech-and-text-unity-ios-android.
SpeechToTextPlugin.jar.zip Anybody suffering from this problem can first update their files from the repository to latest (specially SpeechToText.cs and TextToSpeech.cs) and then replace their jar file from "Assets/Plugins/Android/SpeechToTextPlugin.jar". I have followed and updated @kayabilgehan solution as it had a type casting error and compiled the files from android studio. Thanks @PersistantStudio and @kayabilgehan for your efforts :)
Thank you so much for this !!
from speech-and-text-unity-ios-android.
Related Issues (20)
- .
- Build is failing in xcode
- Registering new Vocabulary for the Speech-To-Text-Plugin to understand (IOS)
- IOS build error by undefined sumbols for arm64
- Error SpeechRecognizer bind to recognition service failed |Android 11 HOT 11
- Build fails for iOS HOT 2
- Speech to text in android not working HOT 9
- Recents problems with Android 11 HOT 2
- Language pt-BR (Brasil) uses pt (Portugal)
- Speech to text doesn't work with popup - false (android) HOT 3
- speech to text just doesnot work
- Unity plugin speechToText not working when isShowPopupAndroid = false HOT 11
- Speech recognition not working HOT 1
- Create text in real time
- TextMeshPro not updating, does anyone know how to solve this? HOT 2
- 2 Android manifest
- Unexpected file found in Frameworks error during iOS Archiving process. HOT 1
- Android build fails
- IOS Text to Speech is not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from speech-and-text-unity-ios-android.