0 votes

I plan to make a tts system in my game where the announcer can announce a players username and announce that they have scored the most points.

I do not have the best knowledge in gdscript so I would need code snippets to understand

my basic understanding is that i need a system to breakdown the words into its parts and then execute the audio file that corresponds to it

word: hello
parts: he, lo
files needed: "he.mp3" , "lo.mp3"
Godot version 3.4.3
in Engine by (12 points)

2 Answers

+1 vote

It's more complex than that. If you want to break down each word into each syllable you have to account for differences in sounds between different words. I don't think you need something that complex for your game. It would be better to just have pre-recorded sentences and play those instead.

by (8,526 points)
0 votes

I did something similar for a math game I made, allowing the game to speak numbers, and the results weren't that bad. I recorded each number from zero through 20, the separate scaling factors (hundred, thousand, million, billion, trillion), then wrote a script to put them all together to speak a number. The results are obviously robotic, as I didn't bother to record various inflections in accordance with where the clips were in the sentence, or even in the same word. It was going to be more work than I was willing to invest.

For generalized speech synthesis, which is what you're implying, you're looking at a ton of work for results that are going to sound painfully robotic (at the very least, you need to record leading, neutral, and trailing inflections for each possible syllable).

I think you'll get better results by recording generic announcements and tying them to players in some other way.

by (401 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.