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

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

Fix critical bug in 'SpeechToText' when trying to get the class instance #47

Closed Xiphereal closed 3 years ago

Xiphereal commented 3 years ago

Hi! While trying to use this library for the speech to text capabilities in Android, I've found what I think is a bug in the 'SpeechToText' class. The bug consists in referencing the class property instance instead of the backing field _instance in the 'Init()' method, so it enters a recursive chain call to the property and ends in causing a stack overflow, making the app to crash.

I've just change it to reference the class backing field_instance, and now it all works as expected.