NAudio icon indicating copy to clipboard operation
NAudio copied to clipboard

Unhandled Exception: System.DllNotFoundException: Unable to load shared library 'mfplat.dll' or one of its dependencies.

Open ghost opened this issue 5 years ago • 4 comments

I am on macOS, but ideally my app should run anywhere that has .NET Core.

I suspect MediaFoundationReader works on Windows only?

Is there a similar multi-purpose reader I can use that is platform-independent?

At the moment I am getting this error in my project:

Unhandled Exception: System.DllNotFoundException: Unable to load shared library 'mfplat.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libmfplat.dll, 1): image not found
   at NAudio.MediaFoundation.MediaFoundationInterop.MFStartup(Int32 version, Int32 dwFlags)
   at NAudio.MediaFoundation.MediaFoundationApi.Startup()
   at NAudio.Wave.MediaFoundationReader.Init(MediaFoundationReaderSettings initialSettings)
   at MyNamespace.Program.Main(String[] args)

ghost avatar Aug 08 '19 14:08 ghost

Yes, Media Foundation is a set of Windows APIs, so you can't use them on other operating systems I'm afraid.

markheath avatar Aug 14 '19 19:08 markheath

As this issue, have any other recommand solution?

mworldstudio avatar Oct 18 '23 02:10 mworldstudio

@nodingneu @markheath @mworldstudio Any resolution for this compatibility?

migueloliveiradev avatar Oct 31 '23 14:10 migueloliveiradev

Unfortunately, you cannot access Windows APIs if you are not running on Windows. So it depends what you are trying to do. For example, if its format conversion (e.g. converting WAV to MP4), then solutions like FFMPEG can be a good idea.

markheath avatar Nov 01 '23 11:11 markheath