https://github.com/oanderoficial/text-in-audio-python
Transformando texto em audio em Python com a biblioteca pyttsx3.
https://github.com/oanderoficial/text-in-audio-python
audio audio-processing python pyttsx3 text-in-audio webaudio
Last synced: 21 days ago
JSON representation
Transformando texto em audio em Python com a biblioteca pyttsx3.
- Host: GitHub
- URL: https://github.com/oanderoficial/text-in-audio-python
- Owner: oanderoficial
- Created: 2021-07-01T21:13:59.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-19T00:27:48.000Z (about 1 year ago)
- Last Synced: 2024-12-04T17:14:00.304Z (3 months ago)
- Topics: audio, audio-processing, python, pyttsx3, text-in-audio, webaudio
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# text-in-audio-python
Transformando texto em audio em Python com a biblioteca pyttsx3.```python
import pyttsx3
def speak_text_from_file(file_path):
with open(file_path, encoding="utf8") as file:
text = file.read()
engine = pyttsx3.init()
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)
engine.setProperty('rate', engine.getProperty('rate') - 35)
engine.setProperty('volume', 3)
engine.setProperty('voice', b'brazil')print(text)
engine.say(text)
engine.runAndWait()speak_text_from_file('/home/ander/Documentos/IA/ia')
```