Spaces:
Runtime error
Runtime error
delete fix
Browse files- app.py +2 -2
- routes/witaiApi/recognizeVoice.py +2 -2
app.py
CHANGED
|
@@ -6,7 +6,9 @@ from flask_limiter.util import get_remote_address
|
|
| 6 |
from routes.helpers import checkSignature, configFile
|
| 7 |
from routes import *
|
| 8 |
|
|
|
|
| 9 |
app = Flask(__name__)
|
|
|
|
| 10 |
app.config['JSON_AS_ASCII'] = False
|
| 11 |
limiter = Limiter(app=app, key_func=get_remote_address, default_limits=["5/minute"], storage_uri="memory://",)
|
| 12 |
|
|
@@ -84,8 +86,6 @@ def getBMPreview(): return osuApi.getPreview(request)
|
|
| 84 |
def getBMFull(): return osuApi.getFull(request)
|
| 85 |
|
| 86 |
if __name__ == "__main__":
|
| 87 |
-
VERSION = '1.0 build79'
|
| 88 |
-
|
| 89 |
config = configFile()
|
| 90 |
with open(config['config-path'], "w") as outfile:
|
| 91 |
config['buildVersion'] = VERSION
|
|
|
|
| 6 |
from routes.helpers import checkSignature, configFile
|
| 7 |
from routes import *
|
| 8 |
|
| 9 |
+
#initing
|
| 10 |
app = Flask(__name__)
|
| 11 |
+
VERSION = '1.0 build80'
|
| 12 |
app.config['JSON_AS_ASCII'] = False
|
| 13 |
limiter = Limiter(app=app, key_func=get_remote_address, default_limits=["5/minute"], storage_uri="memory://",)
|
| 14 |
|
|
|
|
| 86 |
def getBMFull(): return osuApi.getFull(request)
|
| 87 |
|
| 88 |
if __name__ == "__main__":
|
|
|
|
|
|
|
| 89 |
config = configFile()
|
| 90 |
with open(config['config-path'], "w") as outfile:
|
| 91 |
config['buildVersion'] = VERSION
|
routes/witaiApi/recognizeVoice.py
CHANGED
|
@@ -39,13 +39,13 @@ def recognizeVoice(request):
|
|
| 39 |
fileExt = ".wav"
|
| 40 |
audio_output = ffmpeg.output(audio_input.audio, f"{config['temp-path']}/{fileId}{fileExt}")
|
| 41 |
ffmpeg.run(audio_output)
|
| 42 |
-
helpers.deleteAudio(f"
|
| 43 |
with open(f"{config['temp-path']}/{fileId}{fileExt}", 'rb') as f:
|
| 44 |
try: resp = helpers.dictation("ANR3UUMGUHZJFF366EY3YM3FS54QDJPF", f, fileHeader)
|
| 45 |
except Exception as e:
|
| 46 |
noEx = False
|
| 47 |
resp = e
|
| 48 |
-
helpers.deleteAudio(f"
|
| 49 |
try:
|
| 50 |
if resp['text'] == "": return {"status": "pass", "result": "", "details": ""}
|
| 51 |
except: pass
|
|
|
|
| 39 |
fileExt = ".wav"
|
| 40 |
audio_output = ffmpeg.output(audio_input.audio, f"{config['temp-path']}/{fileId}{fileExt}")
|
| 41 |
ffmpeg.run(audio_output)
|
| 42 |
+
helpers.deleteAudio(f"temp/{fileId}.aac")
|
| 43 |
with open(f"{config['temp-path']}/{fileId}{fileExt}", 'rb') as f:
|
| 44 |
try: resp = helpers.dictation("ANR3UUMGUHZJFF366EY3YM3FS54QDJPF", f, fileHeader)
|
| 45 |
except Exception as e:
|
| 46 |
noEx = False
|
| 47 |
resp = e
|
| 48 |
+
helpers.deleteAudio(f"temp/{fileId}{fileExt}")
|
| 49 |
try:
|
| 50 |
if resp['text'] == "": return {"status": "pass", "result": "", "details": ""}
|
| 51 |
except: pass
|