pyttsx3

Unable to use pyttsx3

社会主义新天地 提交于 2021-01-29 09:30:24
问题 I installed pyttsx3 with the pip install pyttsx3 command, then when I run this program an error comes up. The program : import pyttsx3 engine = pyttsx3.init() rate = engine.getProperty('rate') print (rate) engine.setProperty('rate', 125) volume = engine.getProperty('volume') print (volume) engine.setProperty('volume',1.0) voices = engine.getProperty('voices') engine.setProperty('voice', voices[1].id) engine.say("Hello World!") engine.say('My current speaking rate is ' + str(rate)) engine

pygame.error: Not an Ogg Vorbis audio stream

久未见 提交于 2021-01-29 05:26:13
问题 When I try to play a sound which is in .ogg format , I get an error: Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\default\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1884, in __call__ return self.func(*args) File "C:\Users\default\PycharmProjects\pythonProject1\main.py", line 17, in read pygame.mixer.music.load(outfile) pygame.error: Not an Ogg Vorbis audio stream Here's the code: from tkinter import * import pyttsx3 import pygame