Commit fca9deab authored by Andre Julius's avatar Andre Julius 👀
Browse files

Add flask files

parent 6e7089c7
import glob
from config import datadir
index = []
def reload_index():
global index
index = glob.glob1(datadir, "*.wav")
def is_indexed(file_name):
global index
return file_name in index
import wave
import pyaudio
sound ="data/test.wav")
p = pyaudio.PyAudio()
chunk = 1024
stream =,
data = sound.readframes(chunk)
while data != '':
data = sound.readframes(chunk)
from web import web
from api.index import reload_index
reload_index(), host="", port=80)
from flask import Flask
web = Flask(__name__)
from web import views
from flask import redirect, abort, request, jsonify, Response
from web import web
import api.index
@web.route('/', defaults={'path': ''})
def catch_all(path):
""" Catches all requests that are not handled by any other method """
return redirect("/")
def index():
return jsonify(api.index.index)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment