TextToSpeech = {DLLPath = _SourceFolder.."\\AutoPlay\\Docs\\TextToSpeech.dll", StringToTable = function (DelimitedString, Delimiter) tbReturn = {}; local strWorking; local nPos = nil; local strData; local nTableIndex = 1; local nDelimiterLength = String.Length(Delimiter); if(nDelimiterLength < 1)then tbReturn[nTableIndex] = DelimitedString; return tbReturn; end strWorking = DelimitedString; nPos = String.Find(strWorking,Delimiter); while(nPos ~= -1)do strData = String.Left(strWorking,nPos-1); tbReturn[nTableIndex] = strData; nTableIndex = nTableIndex + 1; local nLength = String.Length(strWorking); strWorking = String.Right(strWorking,nLength - (nPos + (nDelimiterLength-1))); nPos = String.Find(strWorking,Delimiter); end if(strWorking ~= "")then tbReturn[nTableIndex] = strWorking; end return tbReturn; end, GetVoices = function () -- Return table of voices voices = DLL.CallFunction(TextToSpeech.DLLPath, "GetVoices", "", DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL); return TextToSpeech.StringToTable(voices, "\r\n"); end, GetVoice = function () -- Return selected voice return DLL.CallFunction(TextToSpeech.DLLPath, "GetVoice", "", DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL); end, SetVoice = function (name) -- NO Return DLL.CallFunction(TextToSpeech.DLLPath, "SetVoice", "\""..name.."\"", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL); end, GetVolume = function () -- Return volumen number return DLL.CallFunction(TextToSpeech.DLLPath, "GetVolume", "", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL); end, SetVolume = function (volume) -- NO Return. Volume is a value from 0 to 100. DLL.CallFunction(TextToSpeech.DLLPath, "SetVolume", volume, DLL_RETURN_TYPE_LONG, DLL_CALL_CDECL); end, GetRate = function () -- Return rate number return DLL.CallFunction(TextToSpeech.DLLPath, "GetRate", "", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL); end, SetRate = function (rate) -- NO Return. Rate is a value from -10 to 10 DLL.CallFunction(TextToSpeech.DLLPath, "SetRate", rate, DLL_RETURN_TYPE_LONG, DLL_CALL_CDECL); end, Speak = function (text) -- NO Return DLL.CallFunction(TextToSpeech.DLLPath, "Speak", "\""..text.."\"", DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL); end, Pause = function () -- NO Return DLL.CallFunction(TextToSpeech.DLLPath, "Pause", "", DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL); end, Resume = function () -- NO Return DLL.CallFunction(TextToSpeech.DLLPath, "Resume", "", DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL); end, GetError = function () -- Return string error return DLL.CallFunction(TextToSpeech.DLLPath, "GetError", "", DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL); end, About = function () -- NO Return DLL.CallFunction(TextToSpeech.DLLPath, "About", "", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL); end}; TextToSpeech.Speak("This is a sample text");