2015-01-21 13:32:47

Hi all,

I tried using universal speech, created by Quentin C, and JFW dll from a c# project in visual studio, and I cannot make them run.

Does someone know how to set up a project to use functions like SayString and make Jaws or NVDA speak some text?
A simple exampe would be apreciated.

Thanks in advance:

Alan

2015-01-21 15:34:07

I don't have a simple example, but you are going to need a p/invoke tutorial.  Go for Universal Speech as the JFW API is Com-Com isn't hard, but p/invoke is simpler.
Here's the MSDN documentation
Someone might actually have some code that's ready to go, but C# isn't overly popular for audiogame development-there are some titles written in it, but everything is commercial as far as I know.

My Blog
Twitter: @ajhicks1992

2015-01-21 21:43:00

Hi, @camlorn

Thank you very much for your help, it's runing perfectly now.

I paste my code below, could be interesting for someone:
//First, add the corresponding using:
using System.Runtime.InteropServices;

// Then declare the class:
public class screenreader
    {
//use this directive to inport the file located on the same folder of your executable       
[DllImport("UniversalSpeech.dll", CharSet = CharSet.Auto)]
//now, the function itself, inported from UniversalSpeech.dll
        public static extern IntPtr speechSay(string text, bool value);
//your code, etc
}

//last but not least, you can call this method anywhere like that o say a string:
screenreader.speechSay("Hello, world", true);
   
It doesn't use more powerful capabilities on the universalSpeech library, but you can inport any other function just the same way.

Have a nice day,

Alan.

2015-02-08 02:49:35

Full disclosure: I wrote such a library, some time ago.

http://screenreaderapiwrapper.codeplex.com/

It's a P/Invoke wrapper around the Universal Speech's earlier version, the ScreenReaderApi. Easy to get through NuGet, if you have that.

Let me know if this does the trick for you.

2015-02-09 11:26:33

@Truecraig, absolutely amazing!

It's exactly what I was looking for. My aproach works but yours is much more complete and profesional smile.

Thank you very much!

P.S: are there important changes in a newer release of UniversalScreenReaderapi? I could try to update the wraper if necesary...
I'm sure this kind of things make all easier for any visually impaired programer (for testing purposes, for example), and a common question in mailing lists, etc...

Good job.