From c163d29e996ab11ee8b947faeaf59f2b04e9a5ac Mon Sep 17 00:00:00 2001 From: Deoy12 <55270451+Deoy12@users.noreply.github.com> Date: Sat, 26 Oct 2019 23:29:32 -0700 Subject: [PATCH] changed record function --- app.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 55dfd31..0fd9ff3 100644 --- a/app.py +++ b/app.py @@ -1,5 +1,6 @@ from flask import Flask, request, render_template, jsonify import speech_recognition as sr +import Textalk.parsestr as parse app = Flask(__name__) @app.route('/') @@ -13,5 +14,8 @@ def record(): with mic as source: r.adjust_for_ambient_noise(source) audio = r.listen(source) - a = r.recognize_google(audio) - return a + text = r.recognize_google(audio) + converted, calculated = parse(text) + return "Text: " + text + "\" + + "Converted:" + converted + "\" + + "Calculated: " + calculated