adding in service account for google

This commit is contained in:
talksik
2023-04-29 08:59:22 -07:00
parent 6820b49f0e
commit 8da2b266ad
4 changed files with 32 additions and 3 deletions
+8 -3
View File
@@ -1,3 +1,6 @@
from dotenv import load_dotenv
load_dotenv()
from flask import Flask, request, abort, send_file
from tempfile import NamedTemporaryFile
import tts
@@ -46,10 +49,12 @@ def transcribe():
# endpoint to convert text to speech and return the file
@app.route("/tts", methods=["GET"])
@app.route("/tts", methods=["POST"])
def text_to_speech():
# get the text from the request
text = request.form.get("text")
# get the text from the request json
content = request.get_json()
text = content['text']
if not text:
abort(400, "Please provide text to convert to speech!")