fix: instrument SF3/Sonatina không phát âm thanh - chuyển SF3->SF2, bỏ convert SF2->SF3, sửa converter

This commit is contained in:
2026-08-02 21:44:49 +07:00
parent 9f762c2a78
commit 73025fc387
5 changed files with 387 additions and 61 deletions
+5 -8
View File
@@ -1,4 +1,4 @@
import os, threading
import os
from fastapi import FastAPI
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
@@ -16,7 +16,6 @@ from app.api.v1.ai_presets import router as ai_presets_router
from app.api.v1.plugins import router as plugins_router
from app.api.v1.media import router as media_router
from app.core.auth import seed_admin
from app.core.soundfont_converter import SoundFontConverter
from app.core.soundfont_scanner import SoundFontAutoScanner
# Ensure storage directories exist
@@ -63,12 +62,10 @@ async def startup_seed_admin():
@app.on_event("startup")
async def startup_convert_soundfonts():
def _run():
try:
SoundFontConverter().batch_convert_all()
except Exception as e:
print(f"[Startup] SoundFont conversion error: {e}")
threading.Thread(target=_run, daemon=True).start()
# SF2 -> SF3 conversion is disabled: the client FluidSynth WASM cannot decode
# Ogg Vorbis (SF3) samples, so converted SF3s would play silence. The download
# endpoint serves SF2 when available and converts SF3 -> SF2 on demand instead.
pass
@app.on_event("startup")
async def startup_sf_scanner():