Sounds play on flutter_soloud instead of three mpv players
ci / core (push) Successful in 27s
ci / server (push) Successful in 1m3s
ci / updater-windows (push) Successful in 10m15s

SoundEngine (platform/audio) opens the device once (2 s after start,
or on the first sound), loads each synthesized sound into memory (no
temp files), plays overlapping voices and is disposed on window close,
before leaving the server. The SfxService interface and its callers
are unchanged; loudness matches the old mpv path (v^6). WAV only, so
no codec libraries are bundled and no build packages are needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
foxyzandClaude Opus 5.5 committed 2026-10-15 17:18:39 +03:00
1 parent fd8064611a
commit b949951ef9
13 files changed
+436 -77

No files matched your search

+7
View File
@@ -73,6 +73,8 @@ Future<void> main(List<String> args) async {
// Linux: the launcher entry and icon Wayland needs (release installs).
unawaited(installDesktopEntry());
runApp(const WatchTogetherApp());
// The sound device opens once the window is up, not on the first sound.
Future.delayed(const Duration(seconds: 2), SessionState.instance.sfx.warmUp);
}
/// Close button / Alt+F4: leave gracefully first (others see "left", a
@@ -88,6 +90,11 @@ class _CloseGuard with WindowListener {
if (_closing) return;
_closing = true;
await memory.save();
try {
await SessionState.instance.sfx.dispose().timeout(const Duration(milliseconds: 500));
} catch (e) {
debugPrint('sound shutdown on close failed: $e');
}
try {
await SessionState.instance.leave().timeout(const Duration(seconds: 2));
} catch (e) {