I'm working on a desktop for bad viewing people, thus I had to find a way to read out texts on the desktop. Windows 7 seems only to allow for TTS-functions in english. The desktop should work in any (western) language. I developed a function to use google-webservice TTS, the function could be usefull to others too.
Example:
cls
say("en","Hello!+I+am+the+first+speaking+program+in+DarkBasic.+That+was+English")
say("de","Hallo+ich+bin+das+erste+sprechende+Programm+in+DarkBasic.+Das+war+Deutsch")
say("fr","Bonjours!+Je+suis+le+premier+program+parlant!+en+DarkBasic.+C'etait+français")
end
function say(in_lang$,In_text$)
`-------------------------------------------------------------------
` (C) Attilla / TGC DB-Forum
`
` called with language and text the function will produce and play
` a mp3 containing the text
`
` Example: say("en","hello+world")
`
` language: a 2-letter language-code as used by your browser to
` indentify the language (a.e. en,fr,de,it...)
` text: s string containing the text to speak
` blanks should be replaced by +-signs
`-------------------------------------------------------------------
url$="http://translate.google.com/translate_tts?tl="+in_lang$+"&q="+in_text$
if file exist("tts.mp3") then delete file "tts.mp3"
load dll "urlmon",1
a=CALL DLL(1,"URLDownloadToFileA",0,url$,"tts.mp3",0,0)
delete dll 1
load music "tts.mp3",1
play music 1
while music playing(1)
sync
endwhile
delete music 1
if file exist("tts.mp3") then delete file "tts.mp3"
endfunction
If someone knows a method to call the windows native tts in any language. I would be thankfull to learn about, because my methode uses a permanent network connection to access the webservice.