Skip to content

fix: Add PresentationCore assembly for Windows sound playback - #7

Open
akshay1845 wants to merge 1 commit into
AviSharmaaa:mainfrom
akshay1845:fix/windows-sound-playback
Open

fix: Add PresentationCore assembly for Windows sound playback#7
akshay1845 wants to merge 1 commit into
AviSharmaaa:mainfrom
akshay1845:fix/windows-sound-playback

Conversation

@akshay1845

@akshay1845 akshay1845 commented Mar 5, 2026

Copy link
Copy Markdown

Fixes #6

Summary

  • Fixed Windows sound playback by adding the required PresentationCore assembly import

Problem

The System.Windows.Media.MediaPlayer class requires the PresentationCore assembly to be loaded. Without it,
PowerShell throws:
Cannot find type [System.Windows.Media.MediaPlayer]: verify that the assembly containing this type is loaded.

Solution

Added Add-Type -AssemblyName PresentationCore; before creating the MediaPlayer object in the Windows sound playback
command.

Testing

Tested and confirmed working on Windows.

The System.Windows.Media.MediaPlayer class requires the PresentationCore
assembly to be loaded. Without it, PowerShell throws:
"Cannot find type [System.Windows.Media.MediaPlayer]"

This fix adds Add-Type -AssemblyName PresentationCore before creating
the MediaPlayer object.

Tested and confirmed working on Windows.
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.

Windows: Sound not playing - missing PresentationCore assembly

2 participants