Open phillipsalbright opened 2 years ago
Hello, do you still have the same problem? I found the solution. When you change scene, the AudioBuffer is destroyed(the object) and not created. You must add DontDestroyOnLoad(this.gameObject) when it is created or have it created again when a scene is loaded.
Hi, I just had the same problem and after looking at the source I figured out two solutions:
With 2.) the Object would just exist in the szene it's used in and it would still be impossible to have two AudioBuffers at the same time.
I have been working on a project where I am using wit.ai for voice recegnition in a scene that can be loaded, exited, and reloaded. I noticed that on the first time the scene was loaded (whether it be as the first scene or through SceneManager.LoadScene), my wit.ai connection works fine with my Wit script being the base of the functionality, being activated and used to recognize voice. I noticed that if I exit the scene and reload it, every time I get a nullReferenceException in WitService on line 155, stemming from Wit.cs line 91.
Past this point, every time that Wit.Activate() is called in order to obtain voice input, this occurs:
Everything I try to work around this exception ends up landing me with a similar nullReferenceException, always having something to do with the AudioBuffer. Is there something I am missing in terms of leaving and entering scenes with Wit.cs?
Here are steps to reproduce this:
This problem is really slowing down the progress of my projects and I hope a fix exists.