Mudanças entre as edições de "Python:Voz"

De BrapciWiki
Ir para navegação Ir para pesquisar
(Criou página com '=PYTTSX= * [https://hackernoon.com/pt/um-tutorial-essencial-de-texto-para-fala-em-python-usando-a-biblioteca-pyttsx3]')
 
 
(2 revisões intermediárias pelo mesmo usuário não estão sendo mostradas)
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]
 +
 
 +
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()

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()