local m = "Message"
local letter = 1
if string.sub(m, letter, letter) == string.lower("m") then
local sound = Instance.new("Sound", script.Parent)
sound.SoundId = "rbxassetid://223782992"
sound.Volume = 1
sound.PlayOnRemove = true
sound:Destroy()
letter = letter + 1
if string.sub(m, letter, letter) == string.lower("e") then
local sound = Instance.new("Sound", script.Parent)
sound.SoundId = "rbxassetid://223777620"
sound.Volume = 1
sound.PlayOnRemove = true
sound:Destroy()
end
end
Please tell me if this works for Text to Speech.
Edit : I made Text-To-Speech months ago! thanks to the people in this thread!
Huh, TTS in Roblox is kinda difficult if you want it as accurate as possible. Pretty sure that’s a lot of different sound clips in less than 5 seconds for words pronounced.
TTS in roblox really isn’t very viable or possible (to a somewhat high quality), especially due to things like people using it to bypass, swear, etc. This is more likely to get your account actually banned.
Also, as @anon81993163 said, that’d be a lot of different sound clips, and would require an insane amount of knowledge on grammar and timing.
Correction: nearly impossible if you want it actually accurate.
Pronunciation isn’t always going to be the same for a letter, and you would have to determine the grammatical structure, you would need likely thousands of sound clips and a way to merge them together seamlessly. Roblox is not the right platform to accomplish something like this.
I agree with @LowPolys. Roblox right now is not equipped to handle this. The best way I can think of is using a generative adversarial neural network to learn a couple hundred basic sounds which can be combined to form most sounds in natural language. You would need to then train another recursive neural network to play the correct sounds at the right times. All of this would require large volumes of speech data (which is luckily available these days) and lots of development time / expertise. Not a project for Roblox!
While I was an intern I did build text to speech into Roblox Studio using a third party service. It was as easy as allowing asset requests from their service, making an instance that would send requests for speech to be synthesised to my server where responses from the third party service were cached, and inheriting most functionality from the Sound instance. Here are some videos of the demo:
pt. 1: the game without text to speech
pt. 2: adding text to speech
pt. 3: the game with text to speech
Unfortunately this was just a 2018 hack week project and was not picked up as an actual feature. You could always make a feature request for it though