Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
478 B
1
Indexable
Never
from flask import Flask, request

from text_to_speech import speak

app = Flask(__name__)

@app.route('/speak', methods=['GET'])
def handle_speak():
    text = request.args.get('text')
    voice = request.args.get('voice')
    pitch = float(request.args.get('pitch'))
    rate = float(request.args.get('rate'))
    volume = float(request.args.get('volume'))

    speak(text, voice, pitch, rate, volume)
    return ''

if __name__ == '__main__':
    app.run()