Hi, i need to know when a viseme event occour in Unity, i see about the _ISpeechVoiceEvents_VisemeEventHandler to call a function every time that the SpVoice object detect a new viseme, but when i run the test Unity just crash.
I’m using Interop.SpeechLib i swa that some functions like GetVoices() can crash the Unity but with the CustomMarshalers that was slove, but it still crashing when use the viseme handler
void Start(){
voice = new SpVoice();
voice.Viseme += new _ISpeechVoiceEvents_VisemeEventHandler(voice_Viseme);
voice.Speak(“Hello World”, SpeechVoiceSpeakFlags.SVSFlagsAsync);
}
// Update is called once per frame
void Update()
{
}
void voice_Viseme(int StreamNo, object StreamPos, int duration,
SpeechLib.SpeechVisemeType nextVisemetype,
SpeechLib.SpeechVisemeFeature visemeFeature,
SpeechLib.SpeechVisemeType currentVisemetype) {
int i = int.Parse(currentVisemetype.ToString().Replace("SVP_", ""));
print(currentVisemetype.ToString().Replace("SVP_", ""));
print(visemeFeature.ToString());
}