Running native code in parallel to unity

Hi,

I want to implement a speech recognition algorithm for IOS as a unity plugin. IOS native code of Speech recognition must always run while unity does some animation and let unity know when there is a spoken word.

But my problem is in case i call this native speech recognition function from unity then unity will stuck there as my function will never stop working and wont return something unless it detects. I need a way to both run my function and unity code at the same time.

Thank you for your suggestions

Best

You can do the detection in a separate thread. That way the native code part can run all the time and when something happens, it can send a message to Unity.