我在大富翁论坛问过这个问题了,不过没人回答.
http://www.delphibbs.com/delphibbs/dispq.asp?lid=3562070问题如下:我用delphi,ms的TTS,想将内容保存为WAV文件,sdk说明档里面的没有delphi的例子,
有个VB的例子比较容易参考:
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 DoEvents=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
问题出在改写上面******的内容的时候,
我写成:
var FileStream : SpFileStream
FileStream.open(FileName, SSFMCreateForWrite, True);
的话会出错.显示是incompatible type:'TSpFileStream' and 'ISpeechBaseStream',
根据上面的代码,Voice.AudioOutputStream = FileStream ,应该是直接赋值的呀!根据SDK说明:
AudioOutputStream Property Syntax:
SpVoice.AudioOutputStream = ISpeechBaseStream 而ISpeechBaseStream 的说明是:The ISpeechBaseStream automation interface defines properties and methods for manipulating data streams.
The ISpeechBaseStream is not an object in its own right, but is implemented by other objects, such as SpFileStream and SpMemoryStream. SAPI does not call ISpeechBaseStream methods, but uses the underlying COM interfaces. For this reason, a custom object cannot be created using the ISpeechBaseStream interface.也就是说TSpFileStream应该和ISpeechBaseStream 之间是不用转换就可以直接赋值的吧??上面的sdk说明档只是节选了部分我认为是重要的,完整点的在我DELPHIBBS论坛上面的连接有:
http://www.delphibbs.com/delphibbs/dispq.asp?lid=3562070谁有过类似经验的请指点一下.
http://www.delphibbs.com/delphibbs/dispq.asp?lid=3562070问题如下:我用delphi,ms的TTS,想将内容保存为WAV文件,sdk说明档里面的没有delphi的例子,
有个VB的例子比较容易参考:
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 DoEvents=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
问题出在改写上面******的内容的时候,
我写成:
var FileStream : SpFileStream
FileStream.open(FileName, SSFMCreateForWrite, True);
的话会出错.显示是incompatible type:'TSpFileStream' and 'ISpeechBaseStream',
根据上面的代码,Voice.AudioOutputStream = FileStream ,应该是直接赋值的呀!根据SDK说明:
AudioOutputStream Property Syntax:
SpVoice.AudioOutputStream = ISpeechBaseStream 而ISpeechBaseStream 的说明是:The ISpeechBaseStream automation interface defines properties and methods for manipulating data streams.
The ISpeechBaseStream is not an object in its own right, but is implemented by other objects, such as SpFileStream and SpMemoryStream. SAPI does not call ISpeechBaseStream methods, but uses the underlying COM interfaces. For this reason, a custom object cannot be created using the ISpeechBaseStream interface.也就是说TSpFileStream应该和ISpeechBaseStream 之间是不用转换就可以直接赋值的吧??上面的sdk说明档只是节选了部分我认为是重要的,完整点的在我DELPHIBBS论坛上面的连接有:
http://www.delphibbs.com/delphibbs/dispq.asp?lid=3562070谁有过类似经验的请指点一下.
解决方案 »
- 关于rxrichedit.seltext属性
- 还在加班中+急啊:请经验专家:如何将webBrowser内容保存成文件?
- 捞分的机会来了 如何实现在richedit控件中用FindDialog向上查找???
- 请问有没有画数据库中表之间关系的控件,谢谢!(在线等)
- 如何在RichText中添加图片和链接?
- DELPHI6用ADO连ACCESS数据库或SQL数据库,为什么不能显示所有记录?!!急,高分!谢谢!
- 请问如何判断光驱中是否有光盘
- 有关DELPHI7.0支持的控件?
- Delphi超级控件包TMS Component Pack 4.3 装完成后在form中可以使用但一编译就提示找不到.dcu文件
- 关于midas中使用socketconnect的问题
- 如何把小数转换成为分数?
- [高分急求]关于程序在一台电脑上只运行一次的方法的疑问
www.smartysoft.cn/smartreadsdk/
我只是想自己做个自己用的程序,买你的SDK要花几百块划不来