2

I have a code which greets user on the page using pyttsx3 module. On localhost it works very well, but on hosting doesn`t.

The main question is:

how can I serve the generated sound and send it across the internet to the browser?

python:

@app.route('/speech', methods=['GET', 'POST'])
def say_txt():
    engine = pyttsx3.init()
    engine.say("Hello John, how can I help you")
    engine.runAndWait()
    return render_template('speech.html', engine=engine)

speech.html:

<h4 class="white-text">
  {{ engine }}
</h4>

engine variable just show the address of memory. That`s it. I showed it for fully understanding.

0 Answers0