From 94224c0c646809c711e61ba1ab791f524a8e1447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Fri, 4 Aug 2017 14:18:06 +0200 Subject: [PATCH 1/2] Serve sound files via Flask for local playback --- soundboard.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/soundboard.py b/soundboard.py index 5d32c74..d6d7616 100644 --- a/soundboard.py +++ b/soundboard.py @@ -1,7 +1,7 @@ import os 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 @@ -49,3 +49,7 @@ def index(sound=None, text=None, video=None): subprocess.Popen(["pkill", "-f", "omxplayer"]) return render_template("index.html", sounds=sounds) + +@app.route("/sounds/") +def sounds(name): + return send_from_directory(config.path, name) From 6e538a6bf89f6e4ac945023f7340a8f3f7734cb6 Mon Sep 17 00:00:00 2001 From: Andreas Erhard Date: Fri, 4 Aug 2017 12:21:09 +0000 Subject: [PATCH 2/2] Update README.rst --- README.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.rst b/README.rst index 1375c80..4ce90ab 100644 --- a/README.rst +++ b/README.rst @@ -59,3 +59,28 @@ Production For production deployment Apache (or other webservers like nginx, lighttpd etc.) should be used. For Apache a sample configuration is provided in the folder `apache` which can be adapted. + +Please keep in mind that you may have to adjust the path to the sound files in your apache config in order to enable local playback on the clients. + +Usage +===== + +Users can browse the webinterface, search for sounds and play them on the remote server or their local browser. + +Additionally to the normal point and click usage there are also several keyboard shortcuts available. + +Keyboard shortcuts +------------------ + +- Navigation items, input fields and sound buttons can be selected by using tab and shift+tab +- esc clears the search field +- enter plays the selected sound +- ctrl+k and ctrl+c kill all sounds +- ctrl+x switches between local and remote playback +- ctrl+enter kills sounds before the selected gets played + + +Live version +============ + +A list of sound requests and already added sounds can be found here: https://pad.wiai.de/p/soundboardTodos \ No newline at end of file