下面是我在MSDN找到的VB代码,好像可以实现这个功能,那位老大能将其翻译成Delphi?
---------------------------------------------------------
Dim FileName As String
Dim FileStream As New SpFileStream
Dim Voice As SpVoice
'Create a SAPI voice
Set Voice = New SpVoice
'The output audio data will be saved to ttstemp.wav file
FileName = “c:/ttstemp.wav"
'Create a file;
set do
Events=True so TTS events will be saved to the file
FileStream.Open FileName, SSFMCreateForWrite, True
'Set the output to the FileStream
Set Voice.AudioOutputStream = FileStream
'Speak the text
Voice.Speak “hello world”
'Close the Stream
FileStream.Close
'Release the objects
Set FileStream = Nothing
Set Voice = Nothing