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?

Daniel Hilgarth
  • 171,043
  • 40
  • 335
  • 443
PHilgarth
  • 285
  • 1
  • 3
  • 19
  • 2
    I would go to **Debug\Windows\Exception Settings** and configure it to _Break In All Exceptions_. Inspecting inner exceptions should give a better clue about what the problem might be. – jsanalytics Nov 19 '15 at 00:25
  • Also, by using the source code from Codeplex, I'm able to step through the code for `MediaFoundationReader()` constructor using the debugger, with no problem. I don't have access to a Windows7 machine I could use to reproduce the exception. "Unfortunately" everything works fine under my Windows 10 machine. – jsanalytics Nov 19 '15 at 01:09
  • Not able to reproduce on win7 sp1. Link to the file? – cviejo Nov 19 '15 at 17:40
  • I just searched google for HRESULT 0x800700EA and found a bunch of sites claiming that this error is linked to corrupted Windows files. I don't know how credible these sites are but since cviejo can't reproduce the error, I consider it a possibility. – Wilsu Nov 23 '15 at 13:43
  • Are you sure the Win7 machine has a codec able to reproduce the file? – owairc Nov 23 '15 at 14:35
  • Could you share the prototype via github for instance? – Boris Sokolov Nov 23 '15 at 15:17
  • jstreet: configure the exception settings to "Break in all exceptions" didn't help me. It's the same exception and the Inner Exception is "null". cviejo: I tried it with multiple links, it's not just one link causing the error. Wilsu: Maybe that's it ... I tried to run the app as an admin like Emanuele Spatola said, but that didn't help me, too. So I have no idea, what else could cause the error. – PHilgarth Nov 23 '15 at 17:42

2 Answers2

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

Avinash Jain
  • 7,200
  • 2
  • 26
  • 40
  • I tried it on my girlfriends win7-system but there occured strange other errors and it didn't work either. Maybe this system is corrupted, too (both PCs are several years old ...). So I'll reinstall my system and try it again, cause this errors are that weird... I think, a corrupted system is the reason. In about 3 months I'll get a new, very good PC, anyway. Thanks for your time ;) – PHilgarth Nov 25 '15 at 19:16
0

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

Try to run the application as Administrator.

Emanuele Spatola
  • 555
  • 3
  • 10