Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NAudio - MediaFoundationReader: constructor doesn't take a delivered m4a-URL (from a youtube-Link)

I am trying to play an M4A (MP4 Audio) file directly from the internet using a URL.
I'm using NAudio with the 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 on my Windows 7 machine it is not working, I am getting an exception from inside the MediaFoundationReader constructor.
Initially, I was getting an ArgumentOutOfRangeException. I tested playing this m4a file in WMP and it was also unable to play it. I downloaded a codec pack and installed it. That helped with WMP but my code was still throwing an exception, albeit another one:

An unchecked exception of type 'System.Runtime.InteropServices.COMException' occurred in NAudio.dll

Additional information: There is more data available. (Exception from HRESULT: 0x800700EA)

Any ideas what could be causing this and how I can fix it?

like image 602
PHilgarth Avatar asked Nov 09 '22 02:11

PHilgarth


1 Answers

With some research i identified this

0X800700ea can occur when your Windows operating system becomes corrupted. There can be numerous reason that this error occur including excessive startup entries, registry errors, hardware/RAM decline, fragmented files, unnecessary or redundant program installations and so on.

Can you try you program in another system and verify

like image 116
Neha Jain Avatar answered Nov 14 '22 21:11

Neha Jain