Bug Description
The extension doesn't play sound on Windows because the PowerShell command is missing the required PresentationCore
assembly import.
Environment
- OS: Windows
- Extension Version: 0.0.4
Root Cause
In dist/extension.js (line 103), the Windows sound playback command is:
cmd = `powershell -c "$p = New-Object System.Windows.Media.MediaPlayer; $p.Open('${filePath}'); $p.Play(); Start-Sleep
3"`;
The System.Windows.Media.MediaPlayer class requires the PresentationCore assembly to be loaded first.
Error
When the extension tries to play sound, PowerShell throws:
Cannot find type [System.Windows.Media.MediaPlayer]: verify that the assembly containing this type is loaded.
Fix
Add Add-Type -AssemblyName PresentationCore; before creating the MediaPlayer object:
cmd = `powershell -c "Add-Type -AssemblyName PresentationCore; $p = New-Object System.Windows.Media.MediaPlayer;
$p.Open('${filePath}'); $p.Play(); Start-Sleep 3"`;
This fix has been tested and confirmed working on Windows.
Bug Description
The extension doesn't play sound on Windows because the PowerShell command is missing the required
PresentationCoreassembly import.
Environment
Root Cause
In
dist/extension.js(line 103), the Windows sound playback command is: