feat(audio): support more upload and music formats

Allow the console and music page to upload common audio formats, expand music track detection and playback source selection beyond wav/dfpwm, and update station list name normalization so common extensions resolve consistently. Bump the station build to v1.0.6.
This commit is contained in:
2026-08-01 06:39:18 +08:00
parent 6610b168d7
commit 1554adf5f1
4 changed files with 57 additions and 29 deletions
+2 -2
View File
@@ -185,7 +185,7 @@
<select id="track_select" onchange="onTrackChange()" style="flex:1; min-width: 200px;"></select>
<button class="btn" onclick="loadTracks()">刷新</button>
<button class="btn btn-primary" onclick="document.getElementById('local_file_input').click()">从本地选择</button>
<input type="file" id="local_file_input" accept=".wav,.dfpwm" style="display:none" onchange="uploadLocalFile(this)" />
<input type="file" id="local_file_input" accept=".wav,.mp3,.ogg,.flac,.m4a,.aac,.opus,.dfpwm" style="display:none" onchange="uploadLocalFile(this)" />
</div>
<div class="row">
@@ -363,7 +363,7 @@
await loadTracks();
// Try to select the uploaded file
const baseName = String(file.name || "").replace(/\.(wav|dfpwm)$/i, "").trim();
const baseName = String(file.name || "").replace(/\.(wav|mp3|ogg|flac|m4a|aac|opus|dfpwm)$/i, "").trim();
const sel = document.getElementById("track_select");
for (let i = 0; i < sel.options.length; i++) {
if (sel.options[i].value === baseName) {