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: [email protected]
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,python,windows,api,win32)