Giter Club home page Giter Club logo

tolk's People

Contributors

dkager avatar fiendish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

tolk's Issues

.net wrapper errors

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.

change the license from LGPL if is it possible

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

Delay in response using Sapi

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.

x64 library inst ad x86

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

Memory behavior of functions taking wchar_t pointers is not documented

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?

compiling tolk with MinGW and a code::blocks project file

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

Python: AttributeError: Tolk

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!

Links in the README are broken

Hey! Just wanted to give a heads up that the links to the latest build and the project page in the README appear to be broken.

Here's the link to the latest build:

image

Here's the link to the project page:

image

Just thought I'd let you know. Thanks!

Example C# ConsoleApp does not detect running NVDA

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:

  1. Nvda is running (and talking wherever I move cursor ;) ), version 2017.3
  2. I run \tolk\examples\c#\ConsoleApp.exe (tolk.dll is in the same directory)
  3. The output shows that:
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!
  1. Moreover it does not fallback to SAPI (I assume that it means, the text will be read by system speech synthesizer, which is available, however is not reading everything wherever I point)

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?

cross-platform support?

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?

autodetection of screen readers when the current one becomes unavailable?

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.

  1. Is it possible to do this automatically?
  2. As a workaround, i did a tolk_unload and a tolk_load when the window regains focus after the user switches back. This does detect screen reader changes but there is a noticeable pause when doing so. Is there a faster way of triggering an autodetection?

.net wrapper errors

The .net wrapper does not search subdirectories in the path for the Tolk.dll

Add ZDSR support

The latest version of ZDSR now supports TTS API named ZDSRAPI. The functions are defined in ZDSRAPI.dll.

Instruction:

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.

  1. 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

  2. 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

  3. Output status
    BOOL WINAPI IsSpeaking()
    Return:
    true: outputting
    false: not yet output

  4. Stop output
    void WINAPI StopSpeak()
    Return: void

Add package manager support

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:

  • NuGet: This is the most important because most development will be .NET or C++ native applications and they can be developed with references to NuGet packages to avoid inclusion of libraries with the sources.
  • PyPI: The second tool in importance because many blind developers develop python programs and it will be nice to have a weel or source build enabled for python package index.
  • Gradle/Maven: For java packages.

Cheers,

Possible x86/x64 issue with SAPI

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! :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.