dziemborowicz / hourglass

The simple countdown timer for Windows.
MIT License
631 stars 112 forks source link

InvalidWmpVersionException when Hourglass launched without WMP installed #210

Closed dziemborowicz closed 2 years ago

dziemborowicz commented 2 years ago

From a user report via email:

I just downloaded Hourglass version 1.11.0, and each time I open it I receive:

System.Windows.Media.InvalidWmpVersionException: Windows Media Player version 10 or later is required. ---> System.Runtime.InteropServices.COMException: MILAVERR_INVALIDWMPVERSION (Exception from HRESULT: 0x88980507)
   --- End of inner exception stack trace ---

This did not happen with 1.10.0

This was likely introduced by f8d9b419e37f0990aafbc2ce81556705da456c76 when Hourglass started reporting media errors instead of just silently failing to play custom sounds. I would have expected that to be hit only when starting to play a sound, but it looks like it might get hit when initializing things?

Or maybe this was the upgrade to .NET Framework 4.5 in 7ff54f9e3aff759f7bc3e71159c7d2af34c1e6de.

A short-term solution may be to roll back the offending change, but a better long-term solution is to stop depending on WMP for sound playback and switch to something like NAudio.

dziemborowicz commented 2 years ago

See also #173.

dziemborowicz commented 2 years ago

Confirmed with the reporter that reverting f8d9b419e37f0990aafbc2ce81556705da456c76 resolves the issue, so that's probably the thing to do for now until I have time to replace the audio stack.