forked from server/soundboard
Serve sound files via Flask for local playback
This commit is contained in:
parent
ed84c4fbe9
commit
94224c0c64
@ -1,7 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from flask import Flask, render_template, request, redirect, url_for
|
from flask import Flask, render_template, request, redirect, url_for, send_from_directory
|
||||||
|
|
||||||
import config
|
import config
|
||||||
|
|
||||||
@ -49,3 +49,7 @@ def index(sound=None, text=None, video=None):
|
|||||||
subprocess.Popen(["pkill", "-f", "omxplayer"])
|
subprocess.Popen(["pkill", "-f", "omxplayer"])
|
||||||
|
|
||||||
return render_template("index.html", sounds=sounds)
|
return render_template("index.html", sounds=sounds)
|
||||||
|
|
||||||
|
@app.route("/sounds/<path:name>")
|
||||||
|
def sounds(name):
|
||||||
|
return send_from_directory(config.path, name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user