wit-ai / wit-unity

Wit-Unity is a Unity C# wrapper around the the Wit.ai rest APIs and is a core component of Voice SDK.

Home Page:https://developer.oculus.com/documentation/unity/voice-sdk-overview/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NullReferenceException when starting recording if there are no connected microphones

jesperlundqvist opened this issue · comments

We've discovered a bug when starting recording on a device with no connected microphones. When starting the recording with Wit.Activate(), we get a NullReferenceException. See the stack trace below for details.

NullReferenceException: Object reference not set to an instance of an object
Facebook.WitAi.Lib.Mic.StartRecording (System.Int32 sampleLen) (at Assets/Oculus/Voice/Lib/Wit.ai/Scripts/Runtime/Lib/Mic.cs:229)
Facebook.WitAi.Wit.Activate (Facebook.WitAi.Configuration.WitRequestOptions requestOptions) (at Assets/Oculus/Voice/Lib/Wit.ai/Scripts/Runtime/Wit.cs:334)
Facebook.WitAi.Wit.Activate () (at Assets/Oculus/Voice/Lib/Wit.ai/Scripts/Runtime/Wit.cs:305)

Note that this is using the Oculus Voice SDK.

This can be easily reproduced on Windows by disabling every sound input device in the sound settings.

Thank you so much for reporting the issue. We will take a look at this soon.

@jesperlundqvist a fix for this has been checked in and is accessible via Wit-Unity v0.0.24. It will likely land in v37 of the Voice SDK.