Comments on: Microsoft Windows Text-to-Speech for Unity https://blog.chadweisshaar.com/2015/07/02/microsoft-speech-for-unity/ Sun, 16 Aug 2020 18:03:25 +0000 hourly 1 https://wordpress.org/?v=6.8.3 By: Chad Weisshaar https://blog.chadweisshaar.com/2015/07/02/microsoft-speech-for-unity/#comment-416 Sun, 16 Aug 2020 18:01:37 +0000 http://gator3305.temp.domains/~cweissha/blog/?p=789#comment-416 In reply to ighoyota@tlu.ee.

Functions have to be in a class. I’ve updated the zip to contain working code. Feel free to re-download. You can also just put those lines you added into a new class by doing this (That class can live right where you put the functions):
public static class Utility
{
public static Coroutine ExecuteLater(this MonoBehaviour behaviour, float delay, System.Action fn)
{
return behaviour.StartCoroutine(_realExecute(delay, fn));
}
static IEnumerator _realExecute(float delay, System.Action fn)
{
yield return new WaitForSeconds(delay);
fn();
}
}

]]>
By: ighoyota@tlu.ee https://blog.chadweisshaar.com/2015/07/02/microsoft-speech-for-unity/#comment-413 Fri, 14 Aug 2020 13:44:31 +0000 http://gator3305.temp.domains/~cweissha/blog/?p=789#comment-413 Hello Chad,

I am facing similar problem as @Alex L,

However, after removing the lines below
//if (Timeline.theTimeline.QReprocessingEvents)
// return;

And adding the code below to a line before public class WindowsVoice : MonoBehaviour { class}, I still get errors.

public static Coroutine ExecuteLater(this MonoBehaviour behaviour, float delay, System.Action fn)
{
return behaviour.StartCoroutine(_realExecute(delay, fn));
}
static IEnumerator _realExecute(float delay, System.Action fn)
{
yield return new WaitForSeconds(delay);
fn();
}

Please advise how I can solve this problem,

Thank you.

]]>
By: Chad Weisshaar https://blog.chadweisshaar.com/2015/07/02/microsoft-speech-for-unity/#comment-412 Tue, 11 Aug 2020 16:34:14 +0000 http://gator3305.temp.domains/~cweissha/blog/?p=789#comment-412 In reply to 85halfnotes.

Top level

]]>
By: 85halfnotes https://blog.chadweisshaar.com/2015/07/02/microsoft-speech-for-unity/#comment-411 Tue, 11 Aug 2020 15:05:30 +0000 http://gator3305.temp.domains/~cweissha/blog/?p=789#comment-411 In reply to Chad Weisshaar.

When you say “outside the WindowsVoice class” does that mean on the top-level or in another class?

]]>
By: Chad Weisshaar https://blog.chadweisshaar.com/2015/07/02/microsoft-speech-for-unity/#comment-410 Mon, 10 Aug 2020 23:16:07 +0000 http://gator3305.temp.domains/~cweissha/blog/?p=789#comment-410 In reply to 85halfnotes.

Well, the most common issue that people have is that they are not deploying 64 bit. Double check your build and make sure you picked x64.

]]>
By: 85halfnotes https://blog.chadweisshaar.com/2015/07/02/microsoft-speech-for-unity/#comment-409 Mon, 10 Aug 2020 22:00:53 +0000 http://gator3305.temp.domains/~cweissha/blog/?p=789#comment-409 Hi, I’m trying to call speak using
WindowsVoice.theVoice.speak(“test”);

but I’m getting
“Member ‘WindowsVoice.speak(string, float)’ cannot be accessed with an instance reference; qualify it with a type name instead [Assembly-CSharp]”

so then I tried
WindowsVoice.speak(“test”);
which compiles but I’m not getting any audio.

Any ideas why? I’m very new to Unity and C# so any help would be appreciated, thank you!

]]>
By: Chad Weisshaar https://blog.chadweisshaar.com/2015/07/02/microsoft-speech-for-unity/#comment-405 Thu, 06 Aug 2020 20:56:34 +0000 http://gator3305.temp.domains/~cweissha/blog/?p=789#comment-405 In reply to Alex L.

I’m sorry about the problems you are seeing. I uploaded a newer version and created dependencies that shouldn’t be there. I’ll try to get a new version uploaded soon, but for now, you can simply delete the line that references the ‘Timeline’ and the following line. For the second error, add this code outside the WindowsVoice class:
public static Coroutine ExecuteLater(this MonoBehaviour behaviour, float delay, System.Action fn)
{
return behaviour.StartCoroutine(_realExecute(delay, fn));
}
static IEnumerator _realExecute(float delay, System.Action fn)
{
yield return new WaitForSeconds(delay);
fn();
}

]]>
By: Alex L https://blog.chadweisshaar.com/2015/07/02/microsoft-speech-for-unity/#comment-403 Sat, 01 Aug 2020 11:22:57 +0000 http://gator3305.temp.domains/~cweissha/blog/?p=789#comment-403 Hello, Chad. I know this is old, but I am trying to use this for my project. However, I am getting two errors:
-Timeline doesn’t exist
-WindowsVoice doesn’t contain ExecuteLater

I downloaded the finished 64 bits dll and the plugin, and I’m on Unity 2019.4.1f. How would I be able to fix this?
Thanks.

]]>
By: Chad Weisshaar https://blog.chadweisshaar.com/2015/07/02/microsoft-speech-for-unity/#comment-396 Sat, 11 Jul 2020 22:38:25 +0000 http://gator3305.temp.domains/~cweissha/blog/?p=789#comment-396 In reply to mastershift.

Thanks. Stopping the speech is done in the voice API by calling pVoice->Pause(). I call this only when destroySpeech() is called. In the destroySpeech function, I set shouldTerminate to true which is checked in the thread’s while loop. When the loop exists I call Pause() then Release().

If you want the ability to pause, you could add another member variable that the thread’s while loop checks to pause and then resume later. If you want to cancel something that is being spoken and drop that line entirely you call Pause() then Speak(nullptr, SPF_ASYNC | SPF_PURGEBEFORESPEAK, nullptr)

]]>
By: mastershift https://blog.chadweisshaar.com/2015/07/02/microsoft-speech-for-unity/#comment-395 Sat, 11 Jul 2020 16:45:52 +0000 http://gator3305.temp.domains/~cweissha/blog/?p=789#comment-395 I know this is kinda old but just in case, thanks for posting it really helped in my project,

but I noticed a problem with using it in my game. How would one go about stopping it in the middle of talking?

Thank you

]]>