python text aloud (pyttsx3)

Deepen your understanding of pyttsx3.

pyttsx3 is a python text-to-speech conversion library. Study with the subject of bodybuilding. It is more motivating to use what you are interested in.

reference

https://pypi.org/project/pyttsx3/ https://coolfitness.jp/bodybuilding_kakegoe/

table of contents

    1. install and import
    1. how to use
    1. Adjustment
  1. Try using it (bodybuilding shout)

1.install and import

install import


pip install pyttsx3
import pyttsx3

2. 2. how to use

Uninflected word


engine = pyttsx3.init()
engine.say("It's out")     #Words you want to output
engine.runAndWait()

3. 3. Adjustment (speed: rate and volume: volume)

Adjustment


engine = pyttsx3.init()


#rate The default value is 200
rate = engine.getProperty('rate')
engine.setProperty('rate',200)

#volume Default value is 1.0, setting is 0.0~1.0
volume = engine.getProperty('volume')
engine.setProperty('volume',1.0)


engine.say("It's out")
engine.runAndWait()

4. Try it (bodybuilding shout)

Try


import pyttsx3
engine = pyttsx3.init()

#Referenced words
words = ["Abdominal muscles, chocolate bar!","Nice bulk!","It's huge! I can't see anything else!",
        "The foundation is different, the foundation!","It's huge!","It's out!","Crunchy",
        "It's finished!","Triangular choco pie!","Abs grenade!",
        "Abdominal muscle torn bread!","I want to grate the radish with the oblique muscles!","The legs are walking!",
        "Great Ketsupuri!","The calf is huge!","My chest looks like a butt!",
         "My chest is torn!","Feathers grow on my back!","I want to jump into the sky!",
        "There is a demon on his back!","Christmas tree on the back!",
         "Nice biceps! Everest!","Santo is also good ~",
        "Shoulder melon!","Do you have a small jeep on your shoulder?"]

rate = engine.getProperty("rate")
engine.setProperty("rate",200)

volume = engine.getProperty('volume')
engine.setProperty('volume',1.0)

#Output of referenced words
for word in words:
    engine.say(word)

engine.runAndWait()

I can't read kanji correctly, but it seems that people who are not good at Japanese are speaking. I'm personally satisfied.

Recommended Posts

python text aloud (pyttsx3)
Text processing in Python
UTF8 text processing in python
Python: Japanese text: Morphological analysis
Speech to speech in python [text to speech]
I made a python text
Python
GOTO in Python with Sublime Text 3
Text extraction with AWS Textract (Python3.6)
Generating multilingual text images using Python
Text mining with Python ① Morphological analysis
Enable Python raw_input with Sublime Text 3
Python: Negative / Positive Analysis: Text Analysis Application
Extract text from images in Python
Sort large text files in Python
[python] Extract text from pdf and read characters aloud with Open-Jtalk
Speak Japanese text with OpenJTalk + python
Reading and writing text in Python
English speech recognition with python [speech to text]
Python3 + pyperclip that rewrites the copied text
Text mining with Python ② Visualization with Word Cloud
Try text mining your diary in Python
python: Creating a ramen timer (pyttsx3, time)
Read text in images with python OCR