khanhuitse05 / speech-and-text-unity-ios-android

Speed to text in Unity iOS use Native Speech Recognition
MIT License
288 stars 124 forks source link

[Feature Request] Catch partial result? #9

Closed foundway closed 2 years ago

foundway commented 5 years ago

Hi,

Thanks for writing this very useful plugin! It works great in my projects!

Now in my next project, I want to do a "recognize as I speak" style. I searched online and find only 1~2 demos but no tutorial nor example codes. I am not very familiar with Objective-C so I hope perhaps you know just the right way to do it. I think it would become a good and useful feature to add to this repo.

Thanks,

elblogbruno commented 5 years ago

Adding this "intent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, "true");" on the Android Project uploaded for creating the plugin and then recreating again the .jar file, seems to activate partial results. then simply : SpeechToText.instance.onPartialResultsCallback = onPartialResultsCallback; void onPartialResultsCallback(string _params) { AddLog("Partial recognition results"+ _params); } It Works for me.

elblogbruno commented 5 years ago

Check this fork by me: https://github.com/elblogbruno/SpeechAndText_Unity_iOS_Android Waiting for maintainer to pull request!