yasirkula / UnitySpeechToText

A native Unity plugin to convert speech to text on Android & iOS
MIT License
72 stars 10 forks source link

android speech waiting time #8

Open wwildeeds opened 3 months ago

wwildeeds commented 3 months ago

The waiting time for speech recognition is too long. After calling the start function and staying quiet, it waits for 5 seconds before ending the speech recognition. Is there a way to adjust the recognition waiting time?"

yasirkula commented 3 months ago

You can change 5.0 here for iOS: https://github.com/yasirkula/UnitySpeechToText/blob/313d88ea3bf05ebeb828da50644bf939f380ecf7/Plugins/SpeechToText/iOS/SpeechToText.mm#L180

PS. For future readers, the 2.0 seconds delay after speaking is configured here: https://github.com/yasirkula/UnitySpeechToText/blob/313d88ea3bf05ebeb828da50644bf939f380ecf7/Plugins/SpeechToText/iOS/SpeechToText.mm#L149

For Android, you can try changing this value via AndroidJavaClass but it's not guaranteed to work: https://github.com/yasirkula/UnitySpeechToText/blob/313d88ea3bf05ebeb828da50644bf939f380ecf7/.github/AAR%20Source%20(Android)/java/com/yasirkula/unity/SpeechToText.java#L25