I am trying to play an M4A (MP4 Audio) file directly from the Internet using a URL.
I am using NAudio with MediaFoundation to achieve this:
using (var reader = new MediaFoundationReader(audioUrl))
This works well on two test systems with Windows 8.1 and Windows 10. But it does not work on my Windows 7 machine, I get an exception from the MediaFoundationReader constructor.
I originally received an ArgumentOutOfRangeException . I tested the playback of this m4a file in WMP, and it also could not play it. I downloaded the codec pack and installed it. This helped WMP, but my code still threw an exception, albeit one more:
Uncontrolled type exception. "System.Runtime.InteropServices.COMException" occurred in the file NAudio.dll
Additional information: More data is available. (Exception from HRESULT: 0x800700EA)
Any ideas what could be causing this and how can I fix it?
source share