browser audio processing phase 1

This commit is contained in:
Joren de Graaf
2026-10-02 16:44:15 +02:00
parent ab6cfc0bae
commit 9c466f8f55
43 changed files with 684 additions and 33 deletions
@@ -9,6 +9,7 @@
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.4/dist/htmx.min.js"></script>
{% vite_asset "frontend/src/entries/dashboard.js" %}
{% include "js_translations.html" %}
{% include "fireworks_detect/includes/browser_processing_config.html" %}
</head>
<body class="dashboard-page">
{% if user.is_authenticated %}<a class="profile-circle" href="{% url "user_settings" %}" aria-label="{% blocktrans with username=user.get_username %}Open settings for {{ username }}{% endblocktrans %}" title="{% trans "Settings" %}">{{ user.get_username|first|upper }}</a>{% endif %}
@@ -9,6 +9,7 @@
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.4/dist/htmx.min.js"></script>
{% vite_asset "frontend/src/entries/fireworks-home.js" %}
{% include "js_translations.html" %}
{% include "fireworks_detect/includes/browser_processing_config.html" %}
</head>
<body>
@@ -30,4 +31,4 @@
</main>
</body>
</html>
</html>
@@ -1,10 +1,10 @@
{% load i18n %}
<form class="upload-form" action="{% url "fireworks_detect:classify_upload" %}" method="post" enctype="multipart/form-data" hx-post="{% url "fireworks_detect:classify_upload" %}" hx-target="#classification-results" hx-swap="innerHTML" hx-encoding="multipart/form-data" hx-indicator="#upload-indicator">
<form class="upload-form audio-upload--idle" action="{% url "fireworks_detect:classify_upload" %}" method="post" enctype="multipart/form-data" hx-post="{% url "fireworks_detect:classify_upload" %}" hx-target="#classification-results" hx-swap="innerHTML" hx-encoding="multipart/form-data" hx-indicator="#upload-indicator" data-scroll-to-results="true">
{% csrf_token %}
<label class="drop-zone" id="drop-zone">
<input class="file-input" id="audio-file" type="file" name="audio" accept="audio/*,.wav,.mp3,.m4a,.ogg,.flac,.aac,.opus" required>
<span>
<span class="upload-icon">↑</span>
<span class="upload-icon" id="upload-progress-circle"><span class="upload-icon__content" id="upload-icon-content" aria-hidden="true">↑</span></span>
<strong>{% trans "Drop an audio file here" %}</strong>
<span>{% trans "or click to browse your device" %}</span>
</span>
@@ -13,6 +13,7 @@
<div class="form-footer">
<p class="file-note">{% trans "WAV, MP3, M4A, OGG and more · 25 MiB maximum" %}</p>
<button type="submit"><span class="spinner htmx-indicator" id="upload-indicator" aria-hidden="true"></span>{% trans "Analyse audio" %}</button>
<button class="upload-cancel" type="button" hidden>{% trans "Cancel upload" %}</button>
</div>
<section id="classification-results" aria-live="polite" aria-label="{% trans "Classification results" %}"></section>
</form>
@@ -0,0 +1 @@
{{ browser_processing_config|json_script:"boomcast-browser-config" }}