python调用win32实现电脑语音

作者: 停下浮躁的心 | 来源:发表于2017-04-22 19:02 被阅读70次

安装pywin32

简介:
Python extensions for Microsoft Windows
Provides access to much of the Win32 API, the
ability to create and use COM objects, and the
Pythonwin environment.

Author: Mark Hammond (et al)
Author_email: mhammond@users.sourceforge.net
Description: Python for Window Extensions
Name: pywin32
Url: http://sourceforge.net/projects/pywin32/
Version: 221

实现

#coding:utf-8
import win32com.client

spk = win32com.client.Dispatch("SAPI.SpVoice")

spk.Speak(u"这里加上要说的话")

相关文章

网友评论

    本文标题:python调用win32实现电脑语音

    本文链接:https://www.haomeiwen.com/subject/cagszttx.html