1 (edited by Dragonlee 2017-12-17 12:30:11)

Hello, I am a beginner programmer. I have been learning how to program with Java for quite some time and I understand all the basics of creating different classes and having them work together for a simple program.

I recently made a little text based game and it runs in the console and I can play it from there, but I wanted to take it from there to the next level, by having text to speech (TTS) and sound effects, instead of just playing it from the boring and dry console. However here I run into an implementation issue due to lack of experience.

I have been searching through the internet for pretty much the whole of the last two days for an answer for how to implement TTS in a java program, with so far very disappointing results. The best I have been able to find  is TTS that is ancient and isn’t even supported anymore.

So my question is whether any of you could please provide advice on implementing TTS in a java program.

I wouldn’t mind if my program wasn’t self voiced, but instead somehow fed text to NVDA or JAWS for it to read. However I am not sure how to implement that in a java program either. So if anyone could advise me with that  too, I would greatly appreciate it.

Thumbs up

2

Tolk has I believe what you want.

if your java app  uses the OS built in console it will already be accessible with screen readers. sounds are another issue that I can not help you with as I do not know java and am unfamiliar with its libraries and tools. good luck in development.

I don’t believe in fighting unnecessarily.  But if something is worth fighting for, then its always a fight worth winning.
check me out on Twitter and on GitHub

Thumbs up

3

Tolk is a good choice, although I think its windows only. If thats an issue there are a few other alternatives such as [FreeTTS], [MaryTTS], and [JARVIS], Jarvis requiring an internet connection as it uses google software. There are a few examples i've found for implementing FreeTTS I can pull up if you like.

As for playing sounds, there are a few examples and tutorials on that [here], [here], and [here].

-BrushTone v1.3.0: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

Thumbs up +1

4

Thanks for  the replies.

So I read the documentation for Tolk and it seems like just what I was looking for .

However still being a big noob, I don't actually know how to  use this third party package in my project.

I am using Eclipse and whenever I try to look up how to use a third party package, it keeps saying I need to locate the .jar file and include it in the buildpath of my project. However when I look through the .zip I downloaded from gitHub, it doesn't seem to contain any .jar file, so i am quite lost as to how to to import this library for use in my project.

hopefully someone can advise me on how to do it.

Thumbs up

5

It's got wrappers for each language, you have to go in there, I haven't messed with it in some time, so I can't say exactly where to go. Your files are probably in the java folder in lang or whatever it is located in.

If you like my posts, thumb them up; if you hate my posts,, thumb them up.

*sits back and watches user karma skyrocket with a huge grin plastered across his face*

Thumbs up

6

The download from [AppVeyor], which may be the same you've got although there's a separate source code one somewhere, has all the compiled binaries you need. The *.jar file is in the "tolk/bin" directory, although you may also have to include Tolk.dll, which is in the x64 or x86 directories in bin depending on your archetecture, along with the associated screen reader drivers located in the "tolk/lib" directory, again x64 or x86 depending.

-BrushTone v1.3.0: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

Thumbs up

7

Yep, Tolk works fine with Java and Swing Gui, I tried it, however, currently I can't find out how to pack dlls and Tolk library into a single jar file along with my application classes. I do it like this when building from command line:
javac -cp ".;tolk.jar" App.java
And then, to create a jar file:
jar -cvfm MyApp.jar manifest.txt *.class

Thumbs up