Skip to content

Commit

Permalink
changed record function
Browse files Browse the repository at this point in the history
  • Loading branch information
Deoy12 committed Oct 27, 2019
1 parent 5a98f51 commit c163d29
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
@@ -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('/')
Expand All @@ -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

0 comments on commit c163d29

Please sign in to comment.