欢迎来到天天文库
浏览记录
ID:6879778
大小:40.00 KB
页数:2页
时间:2018-01-29
《vb 语音读文章方法》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、vb语音读文章方法DimWithEventsVoiceAsSpVoicePrivateSubCombo1_Click() Voice.SpeakvbNullString,2 SetVoice.Voice=Voice.GetVoices().Item(Combo1.ListIndex)EndSubPrivateSubCommand1_Click() SetReadDoc=WebBrowser1.Document.getElementById("content") ReaderTxt=ReadDoc.innerText Voice.Spe
2、akReaderTxt,1EndSubPrivateSubForm_Load() SetVoice=NewSpVoice DimTokenAsISpeechObjectToken ForEachTokenInVoice.GetVoices Combo1.AddItem(Token.GetDescription()) Next Combo1.ListIndex=Combo1.ListCount-1 SetVoice.Voice=Voice.GetVoices().Item(Combo1.ListIndex) '初始化
3、语音库 WebBrowser1.Navigate(App.Path&"/Content.html")EndSubPrivateSubVoice_Word(ByValStreamNumberAsLong,ByValStreamPositionAsVariant,ByValCharacterPositionAsLong,ByValLengthAsLong) OnErrorResumeNext sp=CharacterPosition ep=Length Setbox=WebBrowser1.Document.getElemen
4、tById("content") Setrng=WebBrowser1.Document.body.createTextRange() rng.moveToElementText(box) sp=Int(sp) ep=Int(ep) rng.collapse(True) rng.moveEnd"character",sp+ep rng.moveStart"character",sp rng.Select '问题:阅读Webbrowser控件里的内容时,如果一遇到换行高亮就不准,比当前朗读的内容多。具体的点“朗读演示”就
5、明白了。求高手解决!谢谢! DoEventsEndSub
此文档下载收益归作者所有