ConvertTextToSpeech: Difference between revisions
Jump to navigation
Jump to search
m (→Example:) |
m (→Example:) |
||
Line 38: | Line 38: | ||
convertWordsToSound(messag) | convertWordsToSound(messag) | ||
end)</syntaxhighlight> | end)</syntaxhighlight> | ||
</section> | </section> | ||
Revision as of 19:25, 25 August 2014
- only Server Side
- Author: Has[S]oN
This function converts any word to sound
Syntax:
convertWordsToSound(string text)
Required Arguments:
- text: the Text you want to convert it from word to sound
Code:
Click to collapse [-]
Serverfunction convertWordsToSound(str) local str2 = "" str2 = "http://translate.google.com/translate_tts?tl=en&q="..str.."" triggerClientEvent(source,"VoiceClient",source,str2) end
Click to collapse [-]
Clientfunction sayVoice(str) currentVoice = playSound(str) end addEvent("VoiceClient",true) addEventHandler("VoiceClient",localPlayer,sayVoice)
Example:
Click to collapse [-]
ServeraddEventHandler("onPlayerChat",root, function (messag) convertWordsToSound(messag) end)
More Info
For do the function work with arabic please replace
str2 = "http://translate.google.com/translate_tts?tl=en&q="..str..""
to
str2 = "http://translate.google.com/translate_tts?tl=ar&q="..str..""
thx and sorry for bad english :)