Mudanças entre as edições de "Python:Voz"
Ir para navegação
Ir para pesquisar
(→PYTTSX) |
(→PYTTSX) |
||
| Linha 1: | Linha 1: | ||
=PYTTSX= | =PYTTSX= | ||
* [https://hackernoon.com/pt/um-tutorial-essencial-de-texto-para-fala-em-python-usando-a-biblioteca-pyttsx3 https://hackernoon.com/pt/um-tutorial-essencial-de-texto-para-fala-em-python-usando-a-biblioteca-pyttsx3] | * [https://hackernoon.com/pt/um-tutorial-essencial-de-texto-para-fala-em-python-usando-a-biblioteca-pyttsx3 https://hackernoon.com/pt/um-tutorial-essencial-de-texto-para-fala-em-python-usando-a-biblioteca-pyttsx3] | ||
| + | |||
| + | import pyttsx3 | ||
| + | engine = pyttsx3.init() | ||
| + | engine.say("Hello World") | ||
| + | engine.runAndWait() | ||
| + | ==Volume== | ||
| + | volume = engine.getProperty('volume') | ||
| + | engine.setProperty('volume', volume+0.50) | ||
| + | ==Alterando as vozes== | ||
| + | voices = engine.getProperty('voices') | ||
| + | engine.setProperty('voice', voices[1].id) | ||
Edição das 21h33min de 4 de novembro de 2023
PYTTSX
import pyttsx3
engine = pyttsx3.init()
engine.say("Hello World")
engine.runAndWait()
Volume
volume = engine.getProperty('volume')
engine.setProperty('volume', volume+0.50)
Alterando as vozes
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)