如何使用vba将powerpoint笔记文本转换为语音 [英] how to convert powerpoint note text to speech with vba
本文介绍了如何使用vba将powerpoint笔记文本转换为语音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想编写一个 VBA 宏,使用本机 Windows 语音功能将注释文本转换为语音.
以前有人做过这个吗?
任何提示如何开始和继续?
最后,我需要提供不同的欧盟语言进行转换.
谢谢约翰.
I want to write a VBA macro that converts the note text to speech using the native windows speech capability.
Anyone done this before?
Any tips how to start and proceed?
In the end I will need to provide different EU languages for conversion.
Thanks John.
推荐答案
对了,如上所述,在您的项目中添加对 Microsoft Speech Object Library 的引用.
Right, as mentioned above, add a reference in your project to Microsoft Speech Object Library.
那么这个函数会让你走上正确的道路:
Then this function will set you on the right path:
Function SpeakThis(myPhrase As String)
Dim oSpeaker As New SpeechLib.SpVoice
' Set speech properties
oSpeaker.Volume = 100 ' percent
oSpeaker.Rate = 1 ' multiplier
oSpeaker.SynchronousSpeakTimeout = 1
oSpeaker.AlertBoundary = SVEWordBoundary
If Not myPhrase = "" Then oSpeaker.Speak myPhrase, SVSFDefault
End Function
然后调用:
SpeakThis "Hello, my name is Jamie and I love VBA!"
这篇关于如何使用vba将powerpoint笔记文本转换为语音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文