Mudanças entre as edições de "Python:Voz"
Ir para navegação
Ir para pesquisar
(→PYTTSX) |
(→PYTTSX) |
||
| Linha 12: | Linha 12: | ||
voices = engine.getProperty('voices') | voices = engine.getProperty('voices') | ||
engine.setProperty('voice', voices[1].id) | engine.setProperty('voice', voices[1].id) | ||
| + | ==Salvando em Arquivo | ||
| + | engine.save_to_file("Hello, this is test for pyttsx3.", "test.mp3") | ||
| + | engine.runAndWait() | ||
Edição atual tal como às 21h40min 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)
==Salvando em Arquivo engine.save_to_file("Hello, this is test for pyttsx3.", "test.mp3") engine.runAndWait()