2016-04-24 23:23:56

Hi!
I have here a big problem with UniversalSpeech with c++.
I need a library, that says, wether the screenreader is speaking or not... I got the UniversalSpeech from Githup and tried the example "test.c"...
It didn't work... Then I renamed the file in "test.cpp", but nothing changing... I hope you can help me...


Here is the code of the "test.cpp":


#pragma comment(lib, "libUniversalSpeech.lib")
#include "UniversalSpeech.h"

int main(int argc, char** argv) {
    speechSay("Hello world", 1);
}

and here the error messages, sorry, but the messages are in german, but the code numbers are there...
I loaded a txt file with the log in the dropbox, because I had problems to post this...


click here


Can you help me here or can you me give a library that works and supports sapi, with voice changing, and so on, and with the is speaking function or something else?


Best regards,
Chris.

sorry for my english, I hope you have understood me.

2016-04-25 00:45:25

I believe the problem that you're facing is that not every screen reader has an event for when it has finished speaking. SAPI does, but I'm not sure if any others do. NVDA certainly doesn't when I was looking for one. Shame, as it's my favourite one.

As such, I don't think the Universal Speech library would cater for it, as it's not really a universal capability.

Someone feel free to correct me if I'm wrong on this. Hopefully screen reader vendors will jump on this. Hopefully, if ever I conquer Python, I might be able to work in a speech finished event into NVDA, which would be something.

2016-04-25 00:53:21

hm, interesting... And why isn't universal speech working, maybe I can't get an event but I want use this library...
But, you see, it throw errors...
But thank you for your quick ansver

sorry for my english, I hope you have understood me.

2016-04-26 17:58:56

Hello,

I'm the author of UniversalSpeech.

The main problem I see in your short example code is, that UniversalSpeech expects unicode strings, and not  ANSI strings. Tehrefore you should write:

    speechSay(L"Hello world", 1);

Or if you prefer ANSI strings, use the speechSayA variant. I would advise using unicode, as it allows you to send proper textes in languages having accented characters.  In the newest version you also have the speechSayU variant, which takes UTF-8 strings.


For knowing when exactly a string has finished speaking, unfortunately, SAPI5 is the only engine having it. No screen reader support that functionality otherwise.

There are 10 kinds of people : those who know binary, and those who don't.

2016-04-26 19:49:01

Hi,
sorry, but it don't work.
I tried to compile, here with dev-cpp and it says the following:

A:\Programmierung\c++\universal speech test\main.o    main.cpp:(.text+0x2b): undefined reference to `speechSay'
A:\Programmierung\c++\dev-cpp\collect2.exe    [Error] ld returned 1 exit status
25        A:\Programmierung\c++\dev-cpp\Makefile.win    recipe for target '"unversal' failed

And I have includet the header file... the problem is, dev-cpp hasn't so a good error log. But here on this computer, i can only use a portable version of a ide, and i choosed dev-cpp...

And I tried at home, to copy the example from the downloaded folder, and this didn't work too...

Do you know why?

sorry for my english, I hope you have understood me.

2016-04-29 21:50:31 (edited by chpross 2016-04-29 22:08:38)

Hi,
i tried it now on my own pc, and it doesn't work... here is the code of my test.cpp.

#pragma comment(lib, "libUniversalSpeech.lib")
#include "UniversalSpeech.h"

int main(int argc, char** argv) {
    speechSay(L"Hello world", 1);
}

The Link to the error log is the same, look in the first post...
Can you help me?

best regards
Chris


Edit:
I tranzlated the errors in the log, not all but 90% of them

sorry for my english, I hope you have understood me.

2016-04-30 07:49:45

I remember having trouble getting universal speech to work; it required me to make some changes to the header file that came with the library. I'd recommend using the Tolk library for screen reader abstraction instead because it worked out of the box for me and has a more permissive license if you're looking for commercial usage.

2016-04-30 08:09:59

Hi,
ok, thank you for the hint. I will use tolk, I tried it and it work perfectly...
It doesn't have settings for sapi voices and so on, but it works...

sorry for my english, I hope you have understood me.

2016-05-01 14:16:53

Considering the OP's original problem and it's one I'd like to see solved too, anyone think it's worth making a collaborative effort to ask screen reader vendors to implement some kind of event when their screen reader has finished speaking? Akin to the SAPI one? I could see use for it myself.

Never heard of Tolk before, thanks for the hint.

2016-05-01 16:54:49

See this issue
https://github.com/nvaccess/nvda/issues/5638

It'd be nice if other screen vendors would provide this information, as it is a real problem.

2016-05-04 17:53:24

I remember having trouble getting universal speech to work; it required me to make some changes to the header file that came with the library.

UniversalSpeech is open source. I would be happy to know what changes you had to do in order to make it work. This is collaboration. We don't have all the same compiler.


I'd recommend
using the Tolk library for screen reader abstraction instead because it worked out of the box for me and has a more permissive license if you're looking
for commercial usage.

AGain, UniversalSpeech is open source under LGPL. It means that you can also use it for a commercial project.

There are 10 kinds of people : those who know binary, and those who don't.

2016-05-04 19:48:34

Hi,
I think universalspeech is very good, but it don't work... Maybe you can share the modifed header...
I use for the moment tolk, but when universalspeech will be working, i will get this...

sorry for my english, I hope you have understood me.

2016-05-06 11:38:09

Sorry I don't think I remember what modifications I made to make it work, once I saw Tolk's more liberal commercial license, I never looked back.

2016-05-30 21:36:09

chpross wrote:

Hi,
sorry, but it don't work.
I tried to compile, here with dev-cpp and it says the following:

A:\Programmierung\c++\universal speech test\main.o    main.cpp:(.text+0x2b): undefined reference to `speechSay'
A:\Programmierung\c++\dev-cpp\collect2.exe    [Error] ld returned 1 exit status
25        A:\Programmierung\c++\dev-cpp\Makefile.win    recipe for target '"unversal' failed

And I have includet the header file... the problem is, dev-cpp hasn't so a good error log. But here on this computer, i can only use a portable version of a ide, and i choosed dev-cpp...

And I tried at home, to copy the example from the downloaded folder, and this didn't work too...

Do you know why?

hello,
this is because you haven't linked universalspeech library
dev-cpp doesn't have #pragma comment
go to project options in linker tab i think, add option -luniversalspeech
but the library must be present in your lib directory or specify it with with a uppercase l char
for example, -Lc:\universalspeech\lib