diff --git a/app.py b/app.py index b7da287..5d803e3 100644 --- a/app.py +++ b/app.py @@ -3,7 +3,8 @@ from os.path import join from flask import Flask, render_template from markupsafe import escape -from playsound import playsound +from subprocess import check_output + app = Flask(__name__) @@ -14,6 +15,8 @@ for f in samplefiles: samples.append(f.replace(".wav", "")) +output = check_output(['amixer', 'sset', 'Master', 'unmute']) + @app.route("/") def hello(): return render_template("index.html", samples=samples) @@ -22,7 +25,7 @@ def hello(): @app.route("/play/") def door(sample): if sample in samples: - playsound(join("samples", f"{sample}.wav")) + play_output = check_output(['aplay', '-D', 'hw:0,0', join("samples", f"{sample}.wav")]) return f"

{escape(sample)}!

" else: return "no such sample" diff --git a/requirements.txt b/requirements.txt index 4c5a8d0..147ddd0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,2 @@ Flask Gunicorn -playsound -pygobject