Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Festival library as module to support speech synthesis (text-to-speech) #14011 #20683

Closed
wants to merge 2 commits into from

Conversation

malcolmhoward
Copy link
Contributor

@malcolmhoward malcolmhoward commented Aug 3, 2018

https://en.wikipedia.org/wiki/Festival_Speech_Synthesis_System
http://www.cstr.ed.ac.uk/projects/festival/
There was a mention of text-to-speech as a possible means of increasing accessibility in Godot for developers and application end-users who use screen readers (#14011).

I'm new to Godot engine (and C++) development, and this is my first attempt at creating a module. I wanted to create something portable and bound to an external C++ library. The docs suggested that modules can be zipped up to share with others (http://docs.godotengine.org/en/latest/development/cpp/custom_modules_in_cpp.html?highlight=external#creating-a-new-module), but the majority of the relevant examples in the source seemed to be significantly more complex than the example provided in the documentation.

Right now, this module works on Linux from the build created by scons and Qt Creator, but I haven't tried other operating systems or an export of a game. I may need to add another folder for voices, since Festival needs at least one to use as a default, but I haven't yet looked into configuring the module's path as the appropriate directory.

I'd appreciate any feedback on this, and I hope that it can be helpful to someone. Thanks to anyone who worked on the documentation, as well as the following posts for pointing me in the right direction!: https://www.reddit.com/r/godot/comments/85q04a/how_to_get_text_to_speech_set_up_in_godot_need/ & https://godotengine.org/qa/3475/how-to-link-external-library-in-custom-modules-scsub

@malcolmhoward malcolmhoward changed the title Added Festival module to support for speech synthesis (text-to-speech) #14011 Add Festival library as module to support speech synthesis (text-to-speech) #14011 Aug 3, 2018
@vnen
Copy link
Member

vnen commented Aug 3, 2018

I thought it was possible to use the underlying OS to provide TTS, instead of rolling our own system. It would save us a lot of trouble (configuring voice, speed, and whatnot). Probably the user already has this setup to their liking and it's kind of bothersome to set it up again.

So before you put to much time working on this, you should discuss with devs if this is really wanted. Adding dependencies to Godot always undergo some thought to see if the pros overweight the cons. The IRC channel (#godotengine-devel on Freenode) is the easiest way to reach the main devs.

Also note that we don't use Git submodules in this repository.

@mysticfall
Copy link
Contributor

Is this purely an accessibility feature or is there a chance that it can also be used to create placeholder in-game voices from text sources with API?

@Sslaxx
Copy link

Sslaxx commented Aug 3, 2018

Careful with this. The voices that Festival uses all have wildly varying licenses and terms of use; some (if not most) of them may be problematic with Godot, even if the Festival library itself is MIT license compatible.

@malcolmhoward
Copy link
Contributor Author

malcolmhoward commented Aug 5, 2018

@mysticfall Yep, it could also be used to to create placeholder in-game voice from text sources via the Festival API. So far, I only have the say_text() function implemented, which can be used in a given node script as follows:

        var t = TTS.new()
	var script = "Hello.  This is a test!"
	var is_spoken = t.say_text(script)
	print('is_spoken: ', is_spoken)

You can see Festival's other available external commands at http://www.cstr.ed.ac.uk/projects/festival/manual/festival_28.html#SEC132. One such example, say_file(), reads the contents of a given file.

@mysticfall
Copy link
Contributor

Thanks for the explanation. In that case, I'll probably use the API myself when I'll be implementing dialog features for my project.

@malcolmhoward
Copy link
Contributor Author

You're welcome. I'm working on porting this module to a GDNative plugin. I'll post an update here when that's ready.

@aaronfranke
Copy link
Member

aaronfranke commented Jul 16, 2019

@malcolmhoward What's the status of this? Have you ported this to a GDNative plugin?

I don't think this is worth having built into Godot. Text to speech would simply be bloat for most users.

It's not suitable as-is due to submodules, hasn't been updated, and the author said he's working on making this a GDNative plugin instead. As such, I suggest closing this PR.

@akien-mga
Copy link
Member

I missed that this PR was still open. That's indeed both too niche and too much code and dependencies to add in the core engine, GDNative was created specifically for such use cases.

The module can still be distributed in a thirdparty repo and linked e.g. in https://github.com/Calinou/awesome-godot for users who would want to compile it themselves, until a GDNative alternative is made available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants