python调用win32实现电脑语音

python调用win32实现电脑语音

本文链接:https://blog.csdn.net/superce/article/details/70198196

 

安装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"这里加上要说的话")
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章