标题: 关于如何输出声音文件
[打印本页]
作者: lisyofun
时间: 2009-10-14 22:22
标题: 关于如何输出声音文件
请问如何用vbs或bat输出声音文件,比如下面这个
Dim msg, sapi
msg ="hello"
Set sapi=CreateObject("sapi.spvoice")
sapi.Speak msg
请问怎么把这段声音输出到mp3或wav文件呢
作者: mountvol
时间: 2009-10-15 09:29
Const SSFMCreateForWrite = 3
strText = "bbs.cn-dos.net"
Set objVoice = CreateObject("SAPI.SpVoice")
Set objFile = CreateObject("SAPI.SpFileStream.1")
objFile.Open "C:\Documents and Settings\administrator\桌面\Test.wav", SSFMCreateForWrite
Set objVoice.AudioOutputStream = objFile
objVoice.Speak strText
作者: lisyofun
时间: 2009-10-16 03:52
呵呵,要的就是这个,网上找了很久都没找到。
请问有sapi详细的属性和方法么,不胜感激。
作者: lisyofun
时间: 2009-10-18 16:42
呵呵,找到了,和大家共享。
'属性:
'AlertBoundary 分隔类型,该属性不同,产生的事件就不同
'AllowAudioOutputFormatChangesOnNextSet 允许用户是否能调整音频格式
'AudioOutputStream 通过该属性获得由对象SpFileStream打开的文件数据流,然后通过speak方法朗读出来
'EventInterests 与AlertBoundary类似,用来产生事件的类型
'Priority 优先权
'Rate 朗读速度
'Voice 声音类型
'Volume 声音大小
'方法:
GetVoices 到得声音类型
'Speak 开始朗读
'Pause 暂停
'Resume 从暂停处开始朗读
'Skip 跳过若干单词或句子
'SpeakStream 朗读文件数据流
'WaitUntilDone 延迟一定时间,单位为毫秒
'事件:
'Word 每读完一个单词便产生一次该事件
'VoiceChange 声音改变就产生
'Phoneme 每个音位产生
'EndStream 朗读完毕后产生