NAudio - MediaFoundationReader: The constructor does not accept the delivered m4a URL (from youtube-Link)

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)) //exception using (var wave = new WaveOutEvent()) { wave.Init(reader); wave.Play(); } 

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?

+5
source share
2 answers

With some research, I have identified this.

0X800700ea can occur when your Windows operating system becomes damaged. There are many reasons why this error occurs, including excessive startup entries, registry errors, hardware / RAM reduction, fragmented files, unnecessary or redundant setup programs, etc.

Can you try the program on another system and check

+1
source

Sometimes a user does not have sufficient privileges to run COM methods.

Try running the application as an administrator.

0
source

Source: https://habr.com/ru/post/1235389/


All Articles