dkager / tolk Goto Github PK
View Code? Open in Web Editor NEWScreen reader abstraction library.
License: GNU Lesser General Public License v3.0
Screen reader abstraction library.
License: GNU Lesser General Public License v3.0
My anti-virus flagged the "Project page" link in the Readme as a "Dangerous URL."
For clarity, this is the URL that I think needs to be updated or removed: https://davykager.com/projects/tolk/
Thanks! :)
Created a small project to test in .net 4.0. Called Tolk.Load(); Tolk.Output("some text"); and failed with: A call to PInvoke function 'TolkDotNet!DavyKager.Tolk::Tolk_Output' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
hi,
as you know, gnu licenses has some restrictions, witch is not good at all
one of them is disallow the programmers to use static libraries and forces them to link the shared libraries
i recommend you to change the LGPL to zlib/PNG or BSL-1.0 or MIT or something similar (permissive license) if it is possible
thanks in advance
Hi, first of all thanks for this project, which I used with Java. It works great with Jaws and Nvda, but I notice a greater slowness when using Sapi. Is there a way to reduce it?
Thanks.
helo
I downloaded your last build from link of top of the readme and found that tolk.dll library placed in x86 directory is for x64 cpu
Hello, and thanks for this library!
One thing that is not clear in the API, is who's responsible for the wchar_t* data passed to the various functions. For example, does Tolk_Output() take ownership? Should I delete it? Is it copied? In other words:
auto buf = new wchar_t[txt_len];
// ...
Talk_Output(buf);
delete[] buf; // Is this safe? Is Talk_Output() going to read from the deleted buffer?
hello,
i've compiled tolk with codeblocks and MinGW-w64, with a change and a project file:
in ScreenReaderDriverSapi.h, before #include <sapi.h>
i've added #include <windows.h>
it fixed some errors in mbsystem.h such as type definitions, etc
and, this is the code for the codeblocks project file:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <CodeBlocks_project_file> <FileVersion major="1" minor="6" /> <Project> <Option title="tolk" /> <Option pch_mode="2" /> <Option compiler="gcc" /> <Build> <Target title="Debug"> <Option output="bin/Debug/tolk" prefix_auto="1" extension_auto="1" /> <Option object_output="obj/Debug/" /> <Option type="3" /> <Option compiler="gcc" /> <Option createDefFile="1" /> <Option createStaticLib="1" /> <Compiler> <Add option="-Wall" /> <Add option="-g" /> </Compiler> <Linker> <Add library="user32" /> </Linker> </Target> <Target title="Release"> <Option output="bin/Release/tolk" prefix_auto="1" extension_auto="1" /> <Option object_output="obj/Release/" /> <Option type="3" /> <Option compiler="gcc" /> <Option createDefFile="1" /> <Option createStaticLib="1" /> <Compiler> <Add option="-O2" /> <Add option="-Wall" /> </Compiler> <Linker> <Add option="-s" /> <Add library="user32" /> </Linker> </Target> </Build> <Compiler> <Add option="-std=c++14" /> <Add option="-DUNICODE=1" /> <Add option="-D_EXPORTING=1" /> </Compiler> <Linker> <Add library="advapi32" /> <Add library="ole32" /> <Add library="oleaut32" /> <Add library="user32" /> <Add library="kernel32" /> <Add library="sapi" /> </Linker> <Unit filename="src/ScreenReaderDriver.h" /> <Unit filename="src/ScreenReaderDriverJAWS.cpp" /> <Unit filename="src/ScreenReaderDriverJAWS.h" /> <Unit filename="src/ScreenReaderDriverNVDA.cpp" /> <Unit filename="src/ScreenReaderDriverNVDA.h" /> <Unit filename="src/ScreenReaderDriverSA.cpp" /> <Unit filename="src/ScreenReaderDriverSA.h" /> <Unit filename="src/ScreenReaderDriverSAPI.cpp" /> <Unit filename="src/ScreenReaderDriverSAPI.h" /> <Unit filename="src/ScreenReaderDriverSNova.cpp" /> <Unit filename="src/ScreenReaderDriverSNova.h" /> <Unit filename="src/ScreenReaderDriverWE.cpp" /> <Unit filename="src/ScreenReaderDriverWE.h" /> <Unit filename="src/ScreenReaderDriverZT.cpp" /> <Unit filename="src/ScreenReaderDriverZT.h" /> <Unit filename="src/Tolk.cpp" /> <Unit filename="src/Tolk.h" /> <Unit filename="src/Tolk.rc"> <Option compilerVar="WINDRES" /> </Unit> <Unit filename="src/TolkVersion.h" /> <Unit filename="src/fsapi.c"> <Option compilerVar="CC" /> </Unit> <Unit filename="src/fsapi.h" /> <Unit filename="src/wineyes.c"> <Option compilerVar="CC" /> </Unit> <Unit filename="src/wineyes.h" /> <Unit filename="src/zt.c"> <Option compilerVar="CC" /> </Unit> <Unit filename="src/zt.h" /> <Extensions> <code_completion /> <envvars /> <debugger /> <lib_finder disable_auto="1" /> </Extensions> </Project> </CodeBlocks_project_file>
i couldn't upload that project file because github didn't allow this type of file to be uploaded
thanks
I'm having a problem running the python example.
It seems I'm missing something very basic, but I'd appreciate if someone could help.
I copied src\python\Tolk.py to examples\python.
Then I copied the following dlls to examples\python.
dolapi32.dll
nvdaControllerClient32.dll
nvdaControllerClient64.dll
SAAPI32.dll
SAAPI64.dll
I ran build.bat, and got no output no error.
When I run python ConsoleApp.py, I get the error below.
Traceback (most recent call last):
File "C:\Users\chigo\AppData\Local\Programs\Python\Python312\Lib\ctypes\__init__.py", line 450, in __getattr__
dll = self._dlltype(name)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\chigo\AppData\Local\Programs\Python\Python312\Lib\ctypes\__init__.py", line 379, in __init__
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: Could not find module 'Tolk' (or one of its dependencies). Try using the full path with constructor syntax.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\code\tolk\examples\python\ConsoleApp.py", line 16, in <module>
import Tolk
File "D:\code\tolk\examples\python\Tolk.py", line 11, in <module>
_tolk = cdll.Tolk
^^^^^^^^^
File "C:\Users\chigo\AppData\Local\Programs\Python\Python312\Lib\ctypes\__init__.py", line 452, in __getattr__
raise AttributeError(name)
AttributeError: Tolk
Thanks so much!
Hi,
I was trying to connect my C# (win 7 64bit) application to any synthesizer but more or less it failed. Then my friend told me about Tolk - so I tried this. And another issue emerged:
Tolk -- C# Console App Example
Initializing Tolk...
Querying for the active screen reader driver...
None of the supported screen readers is running
Let's output some text...
Failed to output text
Finalizing Tolk...
Done!
Thanks for the help
Weqqen
PS Btw - when I was experimenting with System.Speech.Internal.Synthesis.VoiceSynthesis.Speak I encountered other problem: when I choose voice other than Anna I got Exception "value cannot be null" like in https://stackoverflow.com/questions/22057049/application-exit-on-synthesizer-speak-system-speech-dll-non-microsoft-voices just after use .Speak() method. Have you maybe encountered this issue in your career?
Are there any future plans of adding support for other screen readers on other operating systems? The ones that come to mind are voice over (mac/iOS), TalkBack on android and Orca on Linux?
Currently, if the current screen reader gets shut down e.g jaws or NVDA, it falls back to SAPI5. When you start another screen reader e.g close jaws, and start NVDA, it doesn't detect that NVDA is running.
The .net wrapper does not search subdirectories in the path for the Tolk.dll
The latest version of ZDSR now supports TTS API named ZDSRAPI. The functions are defined in ZDSRAPI.dll.
ZDSR API (ZDSRAPI) is a set of interfaces provided by ZDSR.
32-bit interface ZDSRAPI.dll;
64-bit interface ZDSRAPI_x64.dll;
The application program puts the interface dll in its own application directory and calls it to obtain the related functions.
Name: ZDSRAPI
Version: 1
Voice control group User programs can send their own program information to the ZDSR for output.
Initialize the voice interface
int WINAPI InitTTS(int channelType, WCHAR* channelName)
Params:
[in] int channelType: 0 Screen Reader channel, 1 independent channel; independent channel not yet implemented
[in] WCHAR* channelName the name of the independent channel, pass NULL when channel type is 0.
Return Value:
0: Success
1: Version does not match
2: Screen Reader is not run yet
3: Already initialized, no need to call repeatedly
Output text
void WINAPI Speak(WCHAR* text, BOOL bInterrupt)
Params:
[in] WCHAR* text: The text will be output (unicode)
[in] BOOL bInterrupt: whether to interrupt outputting
Return: void
Output status
BOOL WINAPI IsSpeaking()
Return:
true: outputting
false: not yet output
Stop output
void WINAPI StopSpeak()
Return: void
Hello,
I found that it is not easy to add tolk into a source-only repository, because it has no support for library package managers.
Tools to be supported:
Cheers,
Hey, first off thanks for the great library! I've used it in a few audio games, and it's you really do seem to have created "one library to rule them all". Very cool! :)
But with that said, I've been having trouble getting SAPI to work, either from C or C#. The library works great with NVDA, but for some reason not with SAPI. Here's my C code:
`#include <stdio.h>
#include "Tolk.h"
int main(int argc, const char **argv)
{
// Load Tolk
Tolk_Load();
// Fallback to SAPI if no AT is running
const wchar_t *AT = Tolk_DetectScreenReader();
if (AT == NULL)
{
// Didn't work
Tolk_TrySAPI(true);
// Didn't work either, alone or together with Tolk_TrySAPI
Tolk_PreferSAPI(true);
}
// Didn't speak
Tolk_Speak(L"So far, so good", true);
// Unload Tolk
Tolk_Unload();
// Keep the console open, and we're done
getchar();
return 0;
}`
As far as I can tell, I've done everything as described in the README. The code compiles, links, and as I said before works like a charm with NVDA (I don't have any other screen readers, so those are the only two I've tried). I've even tried throwing calls to CoInitialize in case COM wasn't loaded (because as far as I know the only way to access SAPI from unmanaged code is through a COM interface). None of it worked.
So I switched to C# and wrote this:
`using System;
using DavyKager;
namespace AT
{
class Program
{
static void Main(string[] args)
{
// Load Tolk and figure out whether to use an AT or SAPI for speech
Tolk.Load();
string at = Tolk.DetectScreenReader();
if (string.IsNullOrEmpty(at))
{
// Again, tried one, the other, and both.
Tolk.TrySAPI(true);
Tolk.PreferSAPI(true);
}
// Try to speak again and unload Tolk
Tolk.Output(args[1], true); // Tried Speak here as well
Tolk.Unload();
}
}
}`
Now if I just use the COM interface (or System.Speech in C#) I can make SAPI speak, so I know SAPI works on my machine. The only thing I can think of is that maybe the x86 version of Tolk won't run SAPI on x64 computers. I use the 32-bit DLLs and lib, so my game will work on 32-bit machines, but I'm running Windows 10 x64. Are you aware of any compatibility issues like that? If you are, please add them to the README; if not, any ideas on what I might be doing wrong? I guess another theory might be that I'm calling output/speak and then unload immediately after it, but that wasn't an issue with NVDA...
Anyway, thanks again for the awesome lib! :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.