在 python 中需要帮助将 windows 通知转换为文本到语音

need help converting windows notifcation to text-to-speach in python

有什么方法可以获取通知示例的 info/text 如果有通知我希望能够将其作为字符串获取以进一步使其成为文本到语音

您可以创建一个 python 脚本,使用 gtts 和 playsound 库将文本转换为语音。

import gtts 
from playsound import playsound  #https://pypi.org/project/playsound/

#Load the string into gtts   
tts = gtts.gTTS("STRINGTOCONVERTTOAUDIO")
filename = "audio.mp3"
#Remove the audio file if already exists
os.remove(filename)   
# save the audio file to a convenient location... 
tts.save(filename)
# play the audio file
playsound(filename)

然后您可以在任何需要的地方在任何操作系统上调用此 script/function。