Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [Plugin] TTS (Text-To-Speech) Windows [Beta]

Author
Message
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 3rd Jun 2017 09:11
Not sure if anyone would have a need for this but a game I've been working on for some time would really benefit from it as a voice for a ships onboard computer, like Aurora in eve online .... just a usage example.

The thought of having to make x-amount of audio files ontop of all the other work was enough to make me abandon the idea but being able to just type out what I want said is just magic.

the plugin has the following functions:

TTS.Init() - must be called before any other TTS functions, return the number of available voices.
TTS.VoiceDescription(Index) - Gets the given voice description.
TTS.VoiceLanguageID(Index) - Gets the given voice language id.
TTS.SetVoice(VoiceIndex) - Sets the active voice. (will default to 0 is not set)
TTS.SetVolume(Volume) - Sets the voice volume (0 to 100) (will default to 100 is not set)
TTS.SetRate(Rate) - Sets the voice rate (good range is 0 to 3 depending on voice)(will default to 0 is not set)
TTS.Speak(Text) - Speaks the given text or adds the text to the stream queue, this is an asynchronous function so it will not lock your app, each time its called the text is added to a queue.
TTS.Status() - Gets the TTS status (0 = paused, 1 = stopped, 2 = speaking).
TTS.Pause() - Pauses the current TTS stream.
TTS.Resume() - Resumes the current TTS stream.
TTS.Stop() - Stops all TTS streams.
TTS.GetStream() - Gets the current stream index.
TTS.SkipStream(Index) Skip the given stream.
TTS.Free() - Unloads TTS resources, call at end of program

The plugin will attempt to load Sapi5 and upon fail will attempt to load Speech11, if no TTS runtime can be found TTS.Init() will return -2, 0 if the runtime is found but no voices, >0 is the number of voices found
it should work on XP and above but only tested on Windows 10

Sapi5: https://www.microsoft.com/en-us/download/details.aspx?id=10121
Speech11: https://www.microsoft.com/en-us/download/details.aspx?id=27225
Languages: https://www.microsoft.com/en-us/download/details.aspx?id=27224

Hope someone finds it useful, C&C welcome

Attachments

Login to view attachments
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 3rd Jun 2017 23:44
Nice one!
I'll check this out and give some feedback.
RickV
TGC Development Director
24
Years of Service
User Offline
Joined: 27th Apr 2000
Location: United Kingdom
Posted: 9th Jun 2017 13:22
Nice plugin!
Development Director
TGC Team
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 10th Jun 2017 05:54
Tremendously cool! Great work and thank you so much for sharing it!

The project won't compile for me, although the .exe works fine. I get this error:
error: Failed to open file for reading /Plugins/TTS/Commands.txt

I only have one voice it seems, so I will look for more. Any tips on that?

PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 10th Jun 2017 07:07 Edited at: 10th Jun 2017 07:15
Did you copy the contents of TTS.zip attached to my first post to your AppGameKit plugins folder (C:\Program Files (x86)\The Game Creators\AGK2\Tier 1\Compiler\Plugins)

more voices can be downloaded from MS but I have been unable to get any more than the 2 already installed on my system to show in the plugin, not sure why

https://www.microsoft.com/en-us/download/details.aspx?id=27224
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 10th Jun 2017 17:28
@PartTimeCoder - the Commands.txt file was not in the zip I downloaded from your first post. I did put the files in my AppGameKit plugins folder.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 10th Jun 2017 19:09
there are 2 files attached, "TTS.zip" and "TTS Example.zip", the commands.txt is in TTS.zip with the dll
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 12th Jun 2017 00:16
Ahh, I see. I didn't notice there were two downloads. Silly me. Thanks!

Login to post a reply

Server time is: 2024-11-24 14:32:16
Your offset time is: 2024-11-24 14:32:16