Skip to content

windows: fix silent audio in unpackaged build (ms-appx -> file path)#3

Merged
JacobStephens2 merged 1 commit into
mainfrom
fix-windows-audio-unpackaged
May 31, 2026
Merged

windows: fix silent audio in unpackaged build (ms-appx -> file path)#3
JacobStephens2 merged 1 commit into
mainfrom
fix-windows-audio-unpackaged

Conversation

@JacobStephens2
Copy link
Copy Markdown
Owner

Bug

On Windows the app window opens but no audio plays.

Cause

AudioEngine loaded the bundled track via ms-appx:///Assets/waterfall.mp3. The app ships unpackaged (WindowsPackageType=None), so the ms-appx:// scheme has no package identity to resolve against — MediaPlayer silently fails to open the source and stays quiet.

Fix

  • Load the asset by its real path next to the executable via AppContext.BaseDirectory (resolves correctly in both packaged and unpackaged builds).
  • Add a MediaFailed handler so future open failures surface in Debug output instead of failing silently.

Verification

Built locally (Release, x64, self-contained, unpackaged) and confirmed audio plays on Windows 10 (previously silent with the same build settings).

🤖 Generated with Claude Code

The app ships unpackaged (WindowsPackageType=None), so the
ms-appx:///Assets/waterfall.mp3 URI has no package identity to resolve
against and MediaPlayer silently fails to open the asset — the window
shows but no sound plays. Load the asset by its real path next to the
executable via AppContext.BaseDirectory, which resolves correctly in both
packaged and unpackaged builds. Also add a MediaFailed handler so future
open failures surface in Debug output instead of failing silently.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@JacobStephens2 JacobStephens2 merged commit 3ec8de4 into main May 31, 2026
1 check passed
@JacobStephens2 JacobStephens2 deleted the fix-windows-audio-unpackaged branch May 31, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant