python调用win32实现电脑语音

安装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"这里加上要说的话")
    原文作者:停下浮躁的心
    原文地址: https://www.jianshu.com/p/dc6c4a0d9f73
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞