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

5

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?

c#
naudio
ms-media-foundation
asked on Stack Overflow Nov 6, 2015 by PHilgarth • edited Nov 16, 2015 by Daniel Hilgarth

2 Answers

1

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

answered on Stack Overflow Nov 23, 2015 by Neha Jain
0

Sometimes the user doesn't have enough privileges to run COM Methods.

Try to run the application as Administrator.

answered on Stack Overflow Nov 21, 2015 by Emanuele Spatola

User contributions licensed under CC BY-SA 3.0