-1

In mac, when you go to settings, you can see dictation and text to speech. I figured out how to use the text to speech in c# by using System.Diagnostics.Process.Start ("say", (“something"));. But how do I use the dictation in c#?

Moddwyn
  • 1
  • 2
  • Is your question _"How to start the Dication app on a Mac through C#"_? [You can't, it's not an app](https://support.apple.com/en-us/HT202584). – CodeCaster Oct 24 '16 at 15:29
  • @CodeCaster no, more like how to access the dictation system through c# because you can access the text to speech. I wanted it to use in my games – Moddwyn Oct 24 '16 at 15:32
  • In the settings in mac, you can change the voice of the text to speech and it changed the voice in System.Diagnostics.Process.Start ("say", “"); and i thought that is connected – Moddwyn Oct 24 '16 at 15:37

1 Answers1

0

Using Process.Start("say", "Hello world") you're not accessing any Speech API, you're simply starting the built-in "say" command on a Mac. That code will be platform-specific and not portable, but if your intended audience is Mac users, then that will be fine.

If you want speech recognition built into your app (so not something like Dictation, where the OS will write the recognized words in the currently focused textbox), then you'll need to program against an API that does this for you.

You can do so using the Microsoft Speech API. I don't know if that's supported on a Mac, given the name I would guess not.

The alternative would be using some platform-independent wrapper library that uses the speech recognition APIs of the platform that it's running on. Some alternatives are mentioned in C# Speech Recognition.

Community
  • 1
  • 1
CodeCaster
  • 147,647
  • 23
  • 218
  • 272